mirror of
https://github.com/boostorg/system.git
synced 2025-12-27 01:08:18 +01:00
Compare commits
5 Commits
boost-1.84
...
feature/is
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2aa5d4d97f | ||
|
|
18edbf75d0 | ||
|
|
52220a0351 | ||
|
|
ffa67ab005 | ||
|
|
d8399efcac |
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -131,9 +131,15 @@ jobs:
|
||||
- toolset: clang
|
||||
compiler: clang++-16
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: ubuntu-latest
|
||||
container: ubuntu:23.04
|
||||
os: ubuntu-latest
|
||||
install: clang-16
|
||||
- toolset: clang
|
||||
compiler: clang++-17
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
container: ubuntu:23.10
|
||||
os: ubuntu-latest
|
||||
install: clang-17
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: macos-11
|
||||
|
||||
@@ -450,6 +450,13 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(BOOST_NO_CXX17_INLINE_VARIABLES)
|
||||
|
||||
template<class T, class E> constexpr in_place_value_t result<T, E>::in_place_value;
|
||||
template<class T, class E> constexpr in_place_error_t result<T, E>::in_place_error;
|
||||
|
||||
#endif
|
||||
|
||||
template<class Ch, class Tr, class T, class E> std::basic_ostream<Ch, Tr>& operator<<( std::basic_ostream<Ch, Tr>& os, result<T, E> const & r )
|
||||
{
|
||||
if( r.has_value() )
|
||||
@@ -652,6 +659,13 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(BOOST_NO_CXX17_INLINE_VARIABLES)
|
||||
|
||||
template<class E> constexpr in_place_value_t result<void, E>::in_place_value;
|
||||
template<class E> constexpr in_place_error_t result<void, E>::in_place_error;
|
||||
|
||||
#endif
|
||||
|
||||
template<class Ch, class Tr, class E> std::basic_ostream<Ch, Tr>& operator<<( std::basic_ostream<Ch, Tr>& os, result<void, E> const & r )
|
||||
{
|
||||
if( r.has_value() )
|
||||
@@ -885,6 +899,13 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(BOOST_NO_CXX17_INLINE_VARIABLES)
|
||||
|
||||
template<class U, class E> constexpr in_place_value_t result<U&, E>::in_place_value;
|
||||
template<class U, class E> constexpr in_place_error_t result<U&, E>::in_place_error;
|
||||
|
||||
#endif
|
||||
|
||||
// operator|
|
||||
|
||||
namespace detail
|
||||
|
||||
@@ -176,3 +176,4 @@ boost_test(TYPE run SOURCES result_and_fn1v.cpp)
|
||||
boost_test(TYPE run SOURCES result_and_fn1r.cpp)
|
||||
boost_test(TYPE run SOURCES result_and_eq_fn1v.cpp)
|
||||
boost_test(TYPE run SOURCES result_and_eq_fn1r.cpp)
|
||||
boost_test(TYPE run SOURCES result_in_place_use.cpp)
|
||||
|
||||
@@ -206,3 +206,4 @@ run result_and_fn1v.cpp : : : $(CPP11) ;
|
||||
run result_and_fn1r.cpp : : : $(CPP11) ;
|
||||
run result_and_eq_fn1v.cpp : : : $(CPP11) ;
|
||||
run result_and_eq_fn1r.cpp : : : $(CPP11) ;
|
||||
run result_in_place_use.cpp : : : $(CPP11) ;
|
||||
|
||||
22
test/result_in_place_use.cpp
Normal file
22
test/result_in_place_use.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright 2023 Peter Dimov.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/system/result.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
template<class T, class U> void test( T const& t, U const& u )
|
||||
{
|
||||
BOOST_TEST_NE( static_cast<void const*>( &t ), static_cast<void const*>( &u ) );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::system;
|
||||
|
||||
test( result<int>::in_place_value, result<int>::in_place_error );
|
||||
test( result<void>::in_place_value, result<void>::in_place_error );
|
||||
test( result<int&>::in_place_value, result<int&>::in_place_error );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
Reference in New Issue
Block a user