tensorflow/core/util/command_line_flags_test.cc
// The returned array is only valid for the lifetime of the input vector.
// We're using const casting because we need to pass in an argv-style array of
// char* pointers for the API, even though we know they won't be altered.
The returned array is only valid for the lifetime of the input vector.
We're using const casting because we need to pass in an argv-style array of
char* pointers for the API, even though we know they won't be altered.
The returned array is only valid for the lifetime of the input vector . We ' re using const casting because we need to pass in an argv - style array of char * pointers for the API even though we know they won ' t be altered .
std::vector<char *> CharPointerVectorFromStrings(
    const std::vector<string> &strings) {
  std::vector<char *> result;
  result.reserve(strings.size());
  for (const string &string : strings) {
    result.push_back(const_cast<char *>(string.c_str()));
  }
  return result;
}
std :: vector < char * > CharPointerVectorFromStrings ( const std :: vector < string > & strings ) { std :: vector < char * > result ; result . reserve ( strings . size ( ) ) ; for ( const string & string : strings ) { result . push_back ( const_cast < char * > ( string . c_str ( ) ) ) ; } return result ; }
The returned array is only valid for the lifetime of the input vector.
The returned array is only valid for the lifetime of the input vector .