literal suffix for string not compiling

I have:

1
2
3
4
5
6
7
8
9
#include <string>

using namespace std;


void f()
{
      auto x = "hello"s;
}


and the compiler complains about the suffix s.

it says:


error C3688: invalid literal suffix 's'; literal operator or literal operator template 'operator ""s' not found


What am I doing wrong?

Regards
It's defined in the namespace std::literals::string_literals.

1
2
3
4
5
void f()
{
	using namespace std::literals::string_literals;
	auto x = "hello"s;
}

https://en.cppreference.com/w/cpp/string/basic_string/operator%22%22s
Got it...

Thanks...
Topic archived. No new replies allowed.