MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
string.hpp
1#ifndef MPQC_UTILITY_STRING_HPP
2#define MPQC_UTILITY_STRING_HPP
3
4#include <string>
5#include <boost/lexical_cast.hpp>
6
7namespace mpqc {
8
11
13 template <typename T>
14 std::string string_cast(const T& value) {
15 return boost::lexical_cast<std::string>(value);
16 }
17
19 struct cstring {
20 template <typename T>
21 explicit cstring(const T& value)
22 : str_(string_cast(value)) {}
23 operator const char*() const {
24 return this->str();
25 }
26 const char* str() const {
27 return str_.c_str();
28 }
29 private:
30 std::string str_;
31 };
32
34
35}
36
37#endif /* MPQC_UTILITY_STRING_HPP */
std::string string_cast(const T &value)
cast type T to string
Definition string.hpp:14
Contains new MPQC code since version 3.
Definition integralenginepool.hpp:37
cstring-like object to cast a value to const char*< > string.
Definition string.hpp:19

Generated at Wed Sep 25 2024 02:45:30 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.12.0.