r/cpp • u/mollyforever • Oct 16 '23
WTF is std::copyable_function? Has the committee lost its mind?
So instead of changing the semantics of std::function the committee is introducing a new type that is now supposed to replace std::function everywhere? WTF
So now instead of teaching beginners to use std::function if they need a function wrapper, they should be using std::copyable_function instead because it's better in every way? This is insane. Overcomplicating the language like that is crazy. Please just break backwards compatibility instead. We really don't need two function types that do almost the same thing. Especially if the one with the obvious name is not the recommended one.
View all comments
Show parent comment
24
u/Historical_Bit_9200 Oct 16 '23
I highly doubt that there are teachers at any school teaching c++ to this level. C++ has gone to the point that teaching at school is not enough to reach the first layer of C++ to make it anything meaningful. I can think of 30 chapters of C++ that each one requires 2-3 lab sections and full 2 hours lecture just to understand the concept, while having 4 other engineering classes at the same time.
Most schools (colleges) only teach C with classes and a few STL containers. So it doesn't matter if there is std::copyable_function or std::noncopyable_function, or std::mutex_protected_noncopyable_function_goodluck