There are still plenty of cases where you want to use new and delete to deal with memory directly. For example, writing a general purpose memory pool to prevent fragmentation and cache line misses.
Great video as always. No longer need to explicitly put new`s or delete`s, unless you work with Qt, then there are bunch of new's and no delete's. Looking for memory leaks is like, where did I lose parent-child relationship.
No longer need to explicitly put `new` or `delete` in code, unless you want to write a custom form of automatic memory management with custom semantics.
Damian Reloaded Or like a specialized version of unique_ptr. For example, my PolymorphicWrapper class allows you to store values of a Polymorphic type, including subclass objects, without slicing as well as in-place construction. Its unspecified how it achieves this, but in practice I just use plain new/delete. I just use that here in case I want to move to having an SBO implementation, and need a raw pointer.
The problem with make_unique and friends is that they don't allow template argument deduction. For me it is critical -- I've got used to tag-dispatching constructors implemented through user-defined deduction guides
@5:59 Does anyone know what the word 'fording' is? "Now it is relatively easy, using variadic templates and *fording* and move semantics that were added in C++ 11? what is 'fording'?
They also contain them, but C++14 differs in that it didn't bring many completely new features/syntax, like e.g. C++17 did, and now C++20 will bring for sure. Of course it's debatable how to define bug fix vs completely new feature..
@2:41 I think it should be std::count_if instead of std::count when used with lambda or it won't compile. Thanks Jason great video!
Good catch!
There are still plenty of cases where you want to use new and delete to deal with memory directly. For example, writing a general purpose memory pool to prevent fragmentation and cache line misses.
Great video as always. No longer need to explicitly put new`s or delete`s, unless you work with Qt, then there are bunch of new's and no delete's. Looking for memory leaks is like, where did I lose parent-child relationship.
Thank you for this new video about C++ 14 #cpp #cplusplus 14
Great video. One more useful helper function introduced in C++14 is - std::quoted().
No longer need to explicitly put `new` or `delete` in code, unless you want to write a custom form of automatic memory management with custom semantics.
That is, you want the ultimate speedz, implementing a pool or something. I understand make_unique can't be optimized away cause it throws?
Damian Reloaded Or like a specialized version of unique_ptr.
For example, my PolymorphicWrapper class allows you to store values of a Polymorphic type, including subclass objects, without slicing as well as in-place construction. Its unspecified how it achieves this, but in practice I just use plain new/delete. I just use that here in case I want to move to having an SBO implementation, and need a raw pointer.
The problem with make_unique and friends is that they don't allow template argument deduction. For me it is critical -- I've got used to tag-dispatching constructors implemented through user-defined deduction guides
@5:59 Does anyone know what the word 'fording' is? "Now it is relatively easy, using variadic templates and *fording* and move semantics that were added in C++ 11? what is 'fording'?
It's forwarding, not fording. Sorry if that was unclear.
@@cppweekly Thank you so much for the response.
Isn't it that all C++ standards are somewhat of a bug fix because of features the introduced in previous "updates".
They also contain them, but C++14 differs in that it didn't bring many completely new features/syntax, like e.g. C++17 did, and now C++20 will bring for sure. Of course it's debatable how to define bug fix vs completely new feature..
You sound tired, hope you're doing well
Hi, first of all, thank you for your awesome work. I was wondering what compiler you are using
He's using godbolt.org/ , which is not exactly a 'compiler' itself, but more for exploring the language and how compilers optimize.
Great video
Thanks!
*Read more*
Esra Erimez I don't agree with you.
With 17 out for 2 years and 20 around the corner a video on 14 seems late to the party. It’s like the many articles still calling 11 “new”.
He's doing these videos in the order that the standards were published, to show how the language has developed.