New answers tagged

3

Answers to your questions Does the usage of the Const template parameter make sense for this scenario? It makes sense to have some way to get the right type for container_iterator and the other type aliases, but you don't need to do it with a template parameter. For example, you could instead just deduce whether the template parameter Container is const or ...


-2

Your code can likely be replaced by Boost's existing template implementation of the same thing, adapters::indexed. Read their code for an idea of anything you might want to change--it's typically quite efficient and portable, although sometimes at the expense of readability. https://stackoverflow.com/questions/53542092/pythons-enumerate-for-c https://www....


2

Avoiding the std::tuple I'm not happy that you have to explicitly specify std::tuple on the call site (see usage below) but I didn't see any way that would still allow the trailing optional timeout argument. There is a way by converting the function to a class that does all the work in its constructor, and then provide a deduction guide, as shown in this ...


Top 50 recent answers are included