Open slonm opened 5 years ago
clang said:
$ clang++-99 -Wall -pedantic -Wextra main.cpp
main.cpp:51:16: error: no viable overloaded '='
name.get() = "value2";
~~~~~~~~~~ ^ ~~~~~~~~
/usr/local/lib/gcc/x86_64-pc-linux-gnu/8.0.1/include/c++/bits/basic_string.h:654:7: note: candidate function not viable: 'this' argument has type
'const std::remove_reference_t<basic_string<char> &>' (aka 'const std::__cxx11::basic_string<char>'), but method is not marked const
operator=(const basic_string& __str)
^
/usr/local/lib/gcc/x86_64-pc-linux-gnu/8.0.1/include/c++/bits/basic_string.h:693:7: note: candidate function not viable: 'this' argument has type
'const std::remove_reference_t<basic_string<char> &>' (aka 'const std::__cxx11::basic_string<char>'), but method is not marked const
operator=(const _CharT* __s)
^
/usr/local/lib/gcc/x86_64-pc-linux-gnu/8.0.1/include/c++/bits/basic_string.h:704:7: note: candidate function not viable: 'this' argument has type
'const std::remove_reference_t<basic_string<char> &>' (aka 'const std::__cxx11::basic_string<char>'), but method is not marked const
operator=(_CharT __c)
^
/usr/local/lib/gcc/x86_64-pc-linux-gnu/8.0.1/include/c++/bits/basic_string.h:722:7: note: candidate function not viable: 'this' argument has type
'const std::remove_reference_t<basic_string<char> &>' (aka 'const std::__cxx11::basic_string<char>'), but method is not marked const
operator=(basic_string&& __str)
^
/usr/local/lib/gcc/x86_64-pc-linux-gnu/8.0.1/include/c++/bits/basic_string.h:776:7: note: candidate function not viable: 'this' argument has type
'const std::remove_reference_t<basic_string<char> &>' (aka 'const std::__cxx11::basic_string<char>'), but method is not marked const
operator=(initializer_list<_CharT> __l)
^
1 error generated.
This is fixed in #30
In the top error (for g++) there are actually two errors. One of them was fixed in #30 but the other appears to still be there. I've tried comiling on g++ 5.5 (yikes I know) and g++ 8.1, same issue. It compiles fine on clang 3.8.
$ g++ main.cpp -o main -O3 --std=c++14
In file included from named_type.hpp:5,
from main.cpp:10:
underlying_functionalities.hpp: In instantiation of ‘struct fluent::MethodCallable<fluent::NamedType<____C_A_T_C_H____T_E_S_T____32()::A&, ____C_A_T_C_H____T_E_S_T____32()::StrongATag, fluent::Callable> >’:
underlying_functionalities.hpp:120:8: required from ‘struct fluent::Callable<fluent::NamedType<____C_A_T_C_H____T_E_S_T____32()::A&, ____C_A_T_C_H____T_E_S_T____32()::StrongATag, fluent::Callable> >’
named_type_impl.hpp:21:19: required from ‘class fluent::NamedType<____C_A_T_C_H____T_E_S_T____32()::A&, ____C_A_T_C_H____T_E_S_T____32()::StrongATag, fluent::Callable>’
main.cpp:283:5: required from here
underlying_functionalities.hpp:115:14: error: forming pointer to reference type ‘____C_A_T_C_H____T_E_S_T____32()::A&’
T const* operator->() const { return std::addressof(this->underlying().get()); }
^~~~~~~~
underlying_functionalities.hpp:116:8: error: forming pointer to reference type ‘____C_A_T_C_H____T_E_S_T____32()::A&’
T* operator->() { return std::addressof(this->underlying().get()); }