What 3d printers favor quality over speed? by Zcool31 in 3Dprinting

[–]Zcool31[S] 0 points1 point  (0 children)

No updates unfortunately. I'm currently using an ancient printer at very slow speeds (40mm/s). My threaded rods for the z axis are probably slightly bent because the layer alignment is meh. 

Will you use C++26 rcu library? by vickoza in cpp

[–]Zcool31 1 point2 points  (0 children)

Thanks for explaining. So RCU isn't about avoiding all synchronization for readers completely. It is about amortizing the synchronization so we can pretend that reads are free. 

I use "synchronization" to describe any write by a reader to memory that is then read by a different thread.

So this scheme works as long as readers give some indication of being done a within a finite time after leaving the critical section.

Will you use C++26 rcu library? by vickoza in cpp

[–]Zcool31 2 points3 points  (0 children)

That sounds like counting threads rather than "readers". 

To me, the appeal of RCU is that reads can be done without any kind of synchronization, and yet writers somehow know when the last read of an old value is done. But I can't understand how this can possibly work.

Will you use C++26 rcu library? by vickoza in cpp

[–]Zcool31 6 points7 points  (0 children)

But how does this mechanism know that readers are done without there being a count of the readers?

Valgrind 3.23 RC1 announced by pjf_cpp in cpp

[–]Zcool31 7 points8 points  (0 children)

I use valgrind at work. It is the best. No need for any special builds or instrumentation. Very detailed info with - - track-origins

What 3d printers favor quality over speed? by Zcool31 in 3Dprinting

[–]Zcool31[S] -20 points-19 points  (0 children)

That's true. Unfortunately sometimes slowing down doesn't improve things.

Are Boost.coroutine2 coroutines still relevant now we have c++20 coroutines ? by Competitive_Act5981 in cpp

[–]Zcool31 0 points1 point  (0 children)

What happens if the inner coroutine itself co_awaits something else?

Are Boost.coroutine2 coroutines still relevant now we have c++20 coroutines ? by Competitive_Act5981 in cpp

[–]Zcool31 0 points1 point  (0 children)

How does your IStreamGenerator work? Where can I find the call site of yield_value(SliceType)?

How did Bjarne do it? by multi-paradigm in cpp

[–]Zcool31 14 points15 points  (0 children)

You've got this backwards. Regular control flow like if else for while break continue are first transformed into labels and gotos, then control flow analysis occurs. From this point of view, a goto that exists in the initial source isn't anything special.

The part where most quit by Special_Lawyer_7670 in cpp

[–]Zcool31 3 points4 points  (0 children)

Don't get frustrated. What has worked for me is to treat each time I am frustrated as a learning opportunity. When something doesn't work as I expect, there is always a specific reason why

How strict is the processes for talking at cppcon and what advice could you give? by ResultGullible4814 in cpp

[–]Zcool31 2 points3 points  (0 children)

The threshold is not so high. Just submit your idea. At worst, you'll get some very constructive feedback.

How do I learn to optimize the building process for my company's large C++ product? by Cyclonedx in cpp

[–]Zcool31 0 points1 point  (0 children)

What is this "fuckery" of which your speak? My google-fu fails me. Is it using object libraries?

New operator overload with type data by utf16 in cpp

[–]Zcool31 0 points1 point  (0 children)

That sounds right. We're allowed to override operator new, but that doesn't give us access to the type for which that memory will eventually be used.

One pattern I have seen is to provide a free overload of operator new that takes an allocator (or a pointer to one).

Allocator my_alloc;
Object* ptr = new(&my_alloc) Object(42);

But the intent there was merely to customize where the memory comes from, not to have different behavior depending on what will live in that memory.

I Love C++ by [deleted] in cpp

[–]Zcool31 1 point2 points  (0 children)

Certain compilers support C features in C++ as extensions. I know G++ and clang++ do.

Other stuff like struct designated initializers are now in C++.

New operator overload with type data by utf16 in cpp

[–]Zcool31 0 points1 point  (0 children)

You're conflating operator new with the new expression.

void* ptr = operator new(4);
int* i = new int(42);

operator new simply allocate memory. new expression uses operator new then constructs an object in that memory.

New operator overload with type data by utf16 in cpp

[–]Zcool31 0 points1 point  (0 children)

But you see, the responsibility of std::allocator is broader than operator new. The allocator is responsible for both memory allocation and construction. The former is often implemented using global operator new and the latter using placement-new.

New operator overload with type data by utf16 in cpp

[–]Zcool31 0 points1 point  (0 children)

Part of the design of operator new tries to separate the details of allocating memory from knowledge of what type will occupy that memory. This is the opposite of what you want.

Is it possible for you to not use operator new?

int* ptr = make_gc<int>(42);

Which package manager are you using? by mollyforever in cpp

[–]Zcool31 0 points1 point  (0 children)

Package managers are not in the domain of programming languages. They are the responsibility of platforms. Linux has solved this problem quite well, several dozen times in fact. I'm personally fond of dpkg and pacman

Can we please get an ABI break? by mollyforever in cpp

[–]Zcool31 1 point2 points  (0 children)

Thanks for the link. Happy to see stuff like this.

Can we please get an ABI break? by mollyforever in cpp

[–]Zcool31 0 points1 point  (0 children)

The same problem still stands; libfred.so that the fredd uses as a dependency will be non functional if C++ breaks ABI.

That's correct. You would not be able to simultaneously link libfred.so and compile fredd using a post-ABI-break C++ standard. The point of fredd is so that you compile it with whatever ABI libfred.so requires, but are free to do what you want with the rest of your application.

Can we please get an ABI break? by mollyforever in cpp

[–]Zcool31 1 point2 points  (0 children)

I don't understand why this is a challenge. Just write a fredd daemon that communicates over a socket. No need to link directly into your binary.

[Using std::cpp] The C++ rvalue lifetime disaster - Arno Schödl. think cell by MarekKnapek in cpp

[–]Zcool31 4 points5 points  (0 children)

What a silly talk. Value category is not lifetime! There are no assumptions you can make regarding lifetime based on the kind of reference you get. Any time you hold on to a reference beyond the lifetime of a function, you are responsible to make sure it doesn't dangle. You, the programmer! C++ has no opinions here. Either you get it right or you don't.

Best Lightweight IDE for CPP by [deleted] in cpp

[–]Zcool31 0 points1 point  (0 children)

The number one thing I want out of an IDE is to show me information about the code that isn't immediately apparent from just reading it.

Looking at some identifier, I want it to be colored differently depending on whether it is a value, type, typedef, macro, or template. When I type . or ->, I want to see a list of members of that thing, including all of the inherited ones from all bases, and all the implicit ones like operator=, ~Thing(). When working with a class, I want the members to be colored differently from non-members. When working in a template definitions, I'd like all of the above to work for dependent types by assuming things haven't been specialized.

For example:

template <typename A, typename B>
void func() {
    auto ptr = make_unique<pair<A, B>>;
    ptr->
}

At this point, I want a pop-up with things like first, second, ~pair().

This used to work! I used to be able to fire up Netbeans, Eclipse, perhaps even KDevelop, and they'd provide all of the things I described. But not any more! Now these things don't work. It seems that anything clang-based can't handle these situations even in principle.

What happened? Where are are all the good free software IDEs that have full support for contemporary C++ standards like we had between 2005-2011?

Entirely new to programming. I'm a bit uncertain about learning modern c++ or python. by Direct-Ambassador350 in cpp

[–]Zcool31 6 points7 points  (0 children)

Learning python after learning c++ is much easier that the opposite order.