0

Watching Stephan T. Lavavej: Core C++ #1, and noticed that he is using begin(collection) and not collection.begin().

What are the advantages ?

newprint
  • 6,936
  • 13
  • 67
  • 109
  • 3
    http://stackoverflow.com/questions/8452130/when-to-use-stdbegin-and-stdend-instead-of-container-specific-versions or http://www.codeproject.com/Articles/570638/Ten-Cplusplus11-Features-Every-Cplusplus-Developer may be relevant.. – Brandon Nov 18 '13 at 00:11

1 Answers1

3

The first advantage that springs to mind is that std::begin(collection) works with plain old arrays.

johnsyweb
  • 136,902
  • 23
  • 188
  • 247