EleFits  4.0.1
A modern C++ API on top of CFitsIO

◆ toCharPtr()

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

Convert a string to a unique_ptr<char[]>.

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. To call some function f(char *) with a string s, do:

f(toCharPtr(s).get());
Euclid::Cfitsio::toCharPtr
std::unique_ptr< char[]> toCharPtr(const std::string &str)
Convert a string to a unique_ptr<char[]>.