1 // Copyright (C) 2013 Vicente J. Botet Escriba
2 //
3 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
4 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 // <boost/thread/synchronized_value.hpp>
7 
8 // class synchronized_value<T,M>
9 
10 // strict_lock_ptr<T,M> operator->();
11 // const_strict_lock_ptr<T,M> operator->() const;
12 
13 #define BOOST_THREAD_VERSION 4
14 
15 #include <boost/thread/synchronized_value.hpp>
16 
17 #include <boost/detail/lightweight_test.hpp>
18 
19 struct S {
fS20   int f() const {return 1;}
gS21   int g() {return 1;}
22 };
23 
main()24 int main()
25 {
26   {
27       boost::synchronized_value<S> v;
28       BOOST_TEST(v->f()==1);
29       BOOST_TEST(v->g()==1);
30   }
31   {
32       const boost::synchronized_value<S> v;
33       BOOST_TEST(v->f()==1);
34   }
35 
36   return boost::report_errors();
37 }
38 
39