Reputation: 1968
below code compiles on Solaris using Sun Studio but on linux using gcc it says strlen is not a member of std.
inline std::string pathname(char const *p)
{
std::string pname;
std::transform(p, p+std::strlen(p), std::back_inserter(pname), platform::switch_slash);
return pname;
}
Thanks
Upvotes: 3
Views: 7791
Reputation: 227608
You need to include the cstring
header to get std::strlen
:
#include <cstring>
Upvotes: 13