Fix issue of getting pointer from std::vector of size 0
C++11 introduced the `std::vector::data()` method. In addition to being more syntatically pleasing, it should correctly handle the condition when the `std::vector` is size 0 and therefore has no real pointer. (Expressions like `&v[0]` are undefined when the `vector` is empty.)
Showing
Please register or sign in to comment