//compile pass
#define STR1 "Hello World"
cout << STR1 " and How are you" << endl
//compile fail
string mystring = "Hello World";
cout << mystring " and How are you" << endl
from typeid(variable).name()
"Hello world" type is : char const
mystringtype is : class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >
не уверен, как заставить их использовать
фактическая проблема встретилась:
#ifdef PLATFORM1
#define DIR "/tmp"
#elif defined(PLATFORM2)
#define DIR getDirInfo()
#endif
for( const std::string& dir:{ "/next_dir",DIR "/next2_dir"}){...}
все нормально в PLATFORM1, но я нахожу способы сделать это в методе PLATFORM2.