I would really like to use your library because I think it's the only one to claim c++11 support (I have to deal with this requirement) and the functional extensions.
git clone https://github.com/TartanLlama/expected.git
echo '#include <tl/expected.hpp>' > test.cpp
g++ -c -I./expected -std=c++11 test.cpp
In file included from test.cpp:1:0:
./expected/tl/expected.hpp:123:31: fout: ‘constexpr E& tl::unexpected<E>::value() const &’ cannot be overloaded
TL_EXPECTED_11_CONSTEXPR E &value() & { return m_val; }
^
./expected/tl/expected.hpp:121:22: fout: with ‘constexpr const E& tl::unexpected<E>::value() const &’
constexpr const E &value() const & { return m_val; }
^
./expected/tl/expected.hpp:127:23: fout: ‘constexpr const E&& tl::unexpected<E>::value() const &&’ cannot be overloaded
constexpr const E &&value() const && { return std::move(m_val); }
^
./expected/tl/expected.hpp:125:32: fout: with ‘constexpr E&& tl::unexpected<E>::value() const &&’
TL_EXPECTED_11_CONSTEXPR E &&value() && { return std::move(m_val); }
^
./expected/tl/expected.hpp:659:22: fout: ‘constexpr const T& tl::detail::expected_operations_base<T, E>::get() const &’ cannot be overloaded
constexpr const T &get() const & { return this->m_val; }
^
./expected/tl/expected.hpp:658:31: fout: with ‘constexpr T& tl::detail::expected_operations_base<T, E>::get() const &’
TL_EXPECTED_11_CONSTEXPR T &get() & { return this->m_val; }
^
./expected/tl/expected.hpp:662:23: fout: ‘constexpr const T&& tl::detail::expected_operations_base<T, E>::get() const &&’ cannot be overloaded
constexpr const T &&get() const && { return std::move(this->m_val); }
^
./expected/tl/expected.hpp:660:32: fout: with ‘constexpr T&& tl::detail::expected_operations_base<T, E>::get() const &&’
TL_EXPECTED_11_CONSTEXPR T &&get() && { return std::move(this->m_val); }
^
./expected/tl/expected.hpp:668:34: fout: ‘constexpr const tl::unexpected<E>& tl::detail::expected_operations_base<T, E>::geterr() const &’ cannot be overloaded
constexpr const unexpected<E> &geterr() const & { return this->m_unexpect; }
^
./expected/tl/expected.hpp:665:43: fout: with ‘constexpr tl::unexpected<E>& tl::detail::expected_operations_base<T, E>::geterr() const &’
TL_EXPECTED_11_CONSTEXPR unexpected<E> &geterr() & {
^
./expected/tl/expected.hpp:673:35: fout: ‘constexpr const tl::unexpected<E>&& tl::detail::expected_operations_base<T, E>::geterr() const &&’ cannot be overloaded
constexpr const unexpected<E> &&geterr() const && {
^
./expected/tl/expected.hpp:669:44: fout: with ‘constexpr tl::unexpected<E>&& tl::detail::expected_operations_base<T, E>::geterr() const &&’
TL_EXPECTED_11_CONSTEXPR unexpected<E> &&geterr() && {
^
./expected/tl/expected.hpp:724:34: fout: ‘constexpr const tl::unexpected<E>& tl::detail::expected_operations_base<void, E>::geterr() const &’ cannot be overloaded
constexpr const unexpected<E> &geterr() const & { return this->m_unexpect; }
^
./expected/tl/expected.hpp:721:43: fout: with ‘constexpr tl::unexpected<E>& tl::detail::expected_operations_base<void, E>::geterr() const &’
TL_EXPECTED_11_CONSTEXPR unexpected<E> &geterr() & {
^
./expected/tl/expected.hpp:729:35: fout: ‘constexpr const tl::unexpected<E>&& tl::detail::expected_operations_base<void, E>::geterr() const &&’ cannot be overloaded
constexpr const unexpected<E> &&geterr() const && {
^
./expected/tl/expected.hpp:725:44: fout: with ‘constexpr tl::unexpected<E>&& tl::detail::expected_operations_base<void, E>::geterr() const &&’
TL_EXPECTED_11_CONSTEXPR unexpected<E> &&geterr() && {
^
In file included from test.cpp:1:0:
./expected/tl/expected.hpp:1331:41: fout: ‘template<class T, class E> template<class F> constexpr tl::expected<T, E> tl::expected<T, E>::or_else(F&&) const &’ cannot be overloaded
template <class F> expected constexpr or_else(F &&f) const & {
^
./expected/tl/expected.hpp:1323:56: fout: with ‘template<class T, class E> template<class F> constexpr tl::expected<T, E> tl::expected<T, E>::or_else(F&&) const &’
template <class F> expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) & {
^
./expected/tl/expected.hpp:1335:41: fout: ‘template<class T, class E> template<class F> constexpr tl::expected<T, E> tl::expected<T, E>::or_else(F&&) const &&’ cannot be overloaded
template <class F> expected constexpr or_else(F &&f) const && {
^
./expected/tl/expected.hpp:1327:56: fout: with ‘template<class T, class E> template<class F> constexpr tl::expected<T, E> tl::expected<T, E>::or_else(F&&) const &&’
template <class F> expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) && {
^
./expected/tl/expected.hpp:1677:31: fout: ‘constexpr T* tl::expected<T, E>::operator->() const’ cannot be overloaded
TL_EXPECTED_11_CONSTEXPR T *operator->() { return valptr(); }
^
./expected/tl/expected.hpp:1675:22: fout: with ‘constexpr const T* tl::expected<T, E>::operator->() const’
constexpr const T *operator->() const { return valptr(); }
^
./expected/tl/expected.hpp:1737:31: fout: ‘constexpr E& tl::expected<T, E>::error() const &’ cannot be overloaded
TL_EXPECTED_11_CONSTEXPR E &error() & { return err().value(); }
^
./expected/tl/expected.hpp:1735:22: fout: with ‘constexpr const E& tl::expected<T, E>::error() const &’
constexpr const E &error() const & { return err().value(); }
^
./expected/tl/expected.hpp:1741:32: fout: ‘constexpr E&& tl::expected<T, E>::error() const &&’ cannot be overloaded
TL_EXPECTED_11_CONSTEXPR E &&error() && { return std::move(err().value()); }
^
./expected/tl/expected.hpp:1739:23: fout: with ‘constexpr const E&& tl::expected<T, E>::error() const &&’
constexpr const E &&error() const && { return std::move(err().value()); }
^
./expected/tl/expected.hpp: In constructor ‘tl::expected<T, E>::expected(const tl::expected<U, G>&)’:
./expected/tl/expected.hpp:1430:3: fout: constexpr constructor does not have empty body
}
^
./expected/tl/expected.hpp: In constructor ‘tl::expected<T, E>::expected(const tl::expected<U, G>&)’:
./expected/tl/expected.hpp:1446:3: fout: constexpr constructor does not have empty body
}
^
./expected/tl/expected.hpp: In constructor ‘tl::expected<T, E>::expected(tl::expected<U, G>&&)’:
./expected/tl/expected.hpp:1460:3: fout: constexpr constructor does not have empty body
}
^
./expected/tl/expected.hpp: In constructor ‘tl::expected<T, E>::expected(tl::expected<U, G>&&)’:
./expected/tl/expected.hpp:1475:3: fout: constexpr constructor does not have empty body
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)