EleFits  5.0.0
A modern C++ API on top of CFITSIO

◆ toCharPtr()

std::unique_ptr< char[]> Euclid::Fits::String::toCharPtr ( const std::string str)

Copy a std::string into a std::unique_ptr<char[]>.

Internally used to work around non-const correctness of CFITSIO: when a function expects a char* instead of a const char*, string::c_str() cannot be used.

See also
CStrArray for multiple strings
Example
To call some function f(char *) with a string s, do:
f(toCharPtr(s).get());
std::unique_ptr< char[]> toCharPtr(const std::string &str)
Copy a std::string into a std::unique_ptr<char[]>.