What is the operator “” in C++?

Those are user-defined literals. They allow you to create stuff like std::string, std::chrono::durations or any user defined type (you can make your own literals) in place:

auto str = "Hello"s; // str is std::string("Hello")
auto sec = 5s;       // sec is 5 std::chrono::seconds

A list of the literal-operators provided by the standard library and their documentation can be found at the bottom of the documentation page I linked.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)