Author
anonymous
almost 7 years ago
Language
Compiler
Options
Author
anonymous
almost 7 years ago
$
prog.cc:9:21: error: no viable overloaded '='
best_string = s;
~~~~~~~~~~~ ^ ~
/opt/wandbox/clang-head/include/c++/v1/string:834:19: note: candidate function not viable: 'this' argument has type 'const std::__1::basic_string<char>', but method is not marked const
basic_string& operator=(const basic_string& __str);
^
/opt/wandbox/clang-head/include/c++/v1/string:840:19: note: candidate function template not viable: 'this' argument has type 'const std::__1::basic_string<char>', but method is not marked const
basic_string& operator=(__self_view __sv) {return assign(__sv);}
^
/opt/wandbox/clang-head/include/c++/v1/string:843:19: note: candidate function not viable: 'this' argument has type 'const std::__1::basic_string<char>', but method is not marked const
basic_string& operator=(basic_string&& __str)
^
/opt/wandbox/clang-head/include/c++/v1/string:846:19: note: candidate function not viable: 'this' argument has type 'const std::__1::basic_string<char>', but method is not marked const
basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
^
/opt/wandbox/clang-head/include/c++/v1/string:848:45: note: candidate function not viable: 'this' argument has type 'const std::__1::basic_string<char>', but method is not marked const
_LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}
^
/opt/wandbox/clang-head/include/c++/v1/string:849:19: note: candidate function not viable: 'this' argument has type 'const std::__1::basic_string<char>', but method is not marked const
basic_string& operator=(value_type __c);
^
prog.cc:7:5: warning: expression result unused [-Wunused-value]
[&best_string = static_cast<const std::string&>(best_string)](const std::string& s)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
Exit Code:
1