diff --git a/test/mem_fn_dm_test.cpp b/test/mem_fn_dm_test.cpp index d958ef0..c2298e7 100644 --- a/test/mem_fn_dm_test.cpp +++ b/test/mem_fn_dm_test.cpp @@ -8,9 +8,9 @@ #endif // -// mem_fn_dm_test.cpp - data members +// mem_fn_dm_test.cpp - data members // -// Copyright (c) 2005 Peter Dimov +// Copyright 2005, 2024 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -18,6 +18,7 @@ // #include +#include #include struct X @@ -52,5 +53,11 @@ int main() BOOST_TEST( boost::mem_fn( &X::m )( cx ) == 603 ); BOOST_TEST( boost::mem_fn( &X::m )( pcx ) == 603 ); + BOOST_TEST_EQ( boost::mem_fn( &X::m )( boost::ref( x ) ), 603 ); + BOOST_TEST_EQ( boost::mem_fn( &X::m )( boost::cref( x ) ), 603 ); + + // boost::mem_fn( &X::m )( boost::ref( x ) ) = 704; + // BOOST_TEST_EQ( x.m, 704 ); + return boost::report_errors(); }