Try using std::vector::data() instead of checking for emptyness.