mirror of
https://github.com/boostorg/compat.git
synced 2026-01-30 07:42:36 +00:00
Compare commits
7 Commits
feature/pr
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
349fb928b5 | ||
|
|
d6fa246a9c | ||
|
|
008ff1c071 | ||
|
|
6050e534ca | ||
|
|
4596e8938e | ||
|
|
e7098ce569 | ||
|
|
96ec9c1b89 |
@@ -292,4 +292,10 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
|||||||
"cppalliance/dronevs2022:1",
|
"cppalliance/dronevs2022:1",
|
||||||
{ TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' },
|
{ TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' },
|
||||||
),
|
),
|
||||||
|
|
||||||
|
windows_pipeline(
|
||||||
|
"Windows VS2026 msvc-14.5",
|
||||||
|
"cppalliance/dronevs2026:1",
|
||||||
|
{ TOOLSET: 'msvc-14.5', CXXSTD: '14,17,20,latest' },
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -397,7 +397,7 @@ struct move_only_function_base
|
|||||||
case op_type::move:
|
case op_type::move:
|
||||||
{
|
{
|
||||||
VT* p = static_cast<VT*>( src->addr() );
|
VT* p = static_cast<VT*>( src->addr() );
|
||||||
new(s.addr()) VT( std::move( *p ) );
|
::new( s.addr() ) VT( std::move( *p ) );
|
||||||
// destruct the element here because move construction will leave the container empty
|
// destruct the element here because move construction will leave the container empty
|
||||||
// outside of this function
|
// outside of this function
|
||||||
p->~VT();
|
p->~VT();
|
||||||
@@ -435,6 +435,22 @@ struct move_only_function_base
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class VT, class ...CArgs>
|
||||||
|
void init_object( std::false_type /* use_sbo */, CArgs&& ...args )
|
||||||
|
{
|
||||||
|
s_.pobj_ = new VT( std::forward<CArgs>( args )... );
|
||||||
|
invoke_ = &mo_invoke_object_holder<RQ, Const, NoEx, VT, R, Args...>::invoke_object;
|
||||||
|
manager_ = &manage_object<VT>;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class VT, class ...CArgs>
|
||||||
|
void init_object( std::true_type /* use_sbo */, CArgs&& ...args )
|
||||||
|
{
|
||||||
|
::new( s_.addr() ) VT( std::forward<CArgs>( args )... );
|
||||||
|
invoke_ = &mo_invoke_local_holder<RQ, Const, NoEx, VT, R, Args...>::invoke_local;
|
||||||
|
manager_ = &manage_local<VT>;
|
||||||
|
}
|
||||||
|
|
||||||
template<class VT, class ...CArgs>
|
template<class VT, class ...CArgs>
|
||||||
void init( std::false_type /* is_function */, CArgs&& ...args )
|
void init( std::false_type /* is_function */, CArgs&& ...args )
|
||||||
{
|
{
|
||||||
@@ -444,18 +460,7 @@ struct move_only_function_base
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !storage::use_sbo<VT>() )
|
init_object<VT>( std::integral_constant<bool, storage::use_sbo<VT>()>{}, std::forward<CArgs>( args )... );
|
||||||
{
|
|
||||||
s_.pobj_ = new VT( std::forward<CArgs>( args )... );
|
|
||||||
invoke_ = &mo_invoke_object_holder<RQ, Const, NoEx, VT, R, Args...>::invoke_object;
|
|
||||||
manager_ = &manage_object<VT>;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
new( s_.addr() ) VT( std::forward<CArgs>( args )... );
|
|
||||||
invoke_ = &mo_invoke_local_holder<RQ, Const, NoEx, VT, R, Args...>::invoke_local;
|
|
||||||
manager_ = &manage_local<VT>;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class VT, class ...CArgs>
|
template<class VT, class ...CArgs>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ int main()
|
|||||||
BOOST_TEST_EQ( boost::compat::bind_back( &X::m, &x )(), -1 );
|
BOOST_TEST_EQ( boost::compat::bind_back( &X::m, &x )(), -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1950)
|
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1960)
|
||||||
|
|
||||||
{
|
{
|
||||||
BOOST_TEST_EQ( boost::compat::bind_back( &X::m, Y() )(), -1 );
|
BOOST_TEST_EQ( boost::compat::bind_back( &X::m, Y() )(), -1 );
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ int main()
|
|||||||
BOOST_TEST_EQ( boost::compat::bind_front( &X::m, &x )(), -1 );
|
BOOST_TEST_EQ( boost::compat::bind_front( &X::m, &x )(), -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1950)
|
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1960)
|
||||||
|
|
||||||
{
|
{
|
||||||
BOOST_TEST_EQ( boost::compat::bind_front( &X::m, Y() )(), -1 );
|
BOOST_TEST_EQ( boost::compat::bind_front( &X::m, Y() )(), -1 );
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ int main()
|
|||||||
BOOST_TEST_EQ( boost::compat::invoke( &X::m, &x ), -1 );
|
BOOST_TEST_EQ( boost::compat::invoke( &X::m, &x ), -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1950)
|
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1960)
|
||||||
{
|
{
|
||||||
BOOST_TEST_EQ( boost::compat::invoke( &X::m, Y() ), -1 );
|
BOOST_TEST_EQ( boost::compat::invoke( &X::m, Y() ), -1 );
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ int main()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1950)
|
#if !BOOST_WORKAROUND(BOOST_MSVC, >= 1920 && BOOST_MSVC < 1960)
|
||||||
{
|
{
|
||||||
constexpr Y y = {};
|
constexpr Y y = {};
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,9 @@ struct callable
|
|||||||
{
|
{
|
||||||
return *p_ + x;
|
return *p_ + x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Should never be called, as this should always fit into the small buffer.
|
||||||
|
void* operator new(std::size_t) { throw 1234; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct noex_callable
|
struct noex_callable
|
||||||
@@ -122,6 +125,9 @@ struct noex_callable
|
|||||||
{
|
{
|
||||||
return *p_ + x;
|
return *p_ + x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Should never be called, as this should always fit into the small buffer.
|
||||||
|
void* operator new(std::size_t) { throw 1234; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct large_callable
|
struct large_callable
|
||||||
|
|||||||
Reference in New Issue
Block a user