Begin and End with range-based for loops

Photo by Just Software Solutions

Start using `begin` and `end` without defining a global function templates or via preferences of `std::begin`, `std::end`. Simplest possible solutions are usually the best so it would be to easier to just declare the functions the same way that `std::begin()` and `std::end()` are already declared.

Trigger `SFINE` so only types which have a public member can be invoked with empty parameters, so any other use cases won't be affected, hence no other overloading in the system.

"On slack the other day, someone mentioned that lots of companies don't use range-based for loops in their code because they use PascalCase identifiers, and their containers thus have Begin and End mem..."

Read more on the site

View Article

More info
#6th in TOP Native articles
Level Junior


Added by: Jack
Report article