Chinese Yellow Pages | Classifieds | Knowledge | Tax | IME

modules

concept ( can put some limit/restrict on the template type )

template <template-parameter-list>
concept concept-name = constraint-expression;

https://ggulgulia.medium.com/c-20-concepts-part-1-the-basics-40f051c72776

#include <iostream>
#include <vector>//first define a concept for print
//lets call it 'Printable'template<typename T>
concept Printable = requires(std::ostream& os, const T& msg)
{
    {os << msg};
};//now impose the constraint define above on print method
template <Printable T>
void print(const T& msg){
    std::cout << msg;
}

ranges


Here, the filtering and transformation operations are not performed until we actually iterate through the result. This lazy evaluation reduces memory usage and CPU time. The code is simpler, cleaner, and definitely smarter

coroutines ( hard to use )

https://www.vishalchovatiya.com/cpp20-coroutine-under-the-hood/

 

 

 

https://www.incredibuild.com/blog/what-you-need-to-do-to-move-on-to-c-20-the-complete-list

 

Leave a Reply

Your email address will not be published. Required fields are marked *