1//
2// Test that a base_from_member<T&> can be properly constructed
3//
4// Copyright 2014 Agustin Berge
5//
6// Distributed under the Boost Software License, Version 1.0.
7// See accompanying file LICENSE_1_0.txt or copy at
8// http://www.boost.org/LICENSE_1_0.txt
9//
10
11#include <boost/utility/base_from_member.hpp>
12
13#include <boost/detail/lightweight_test.hpp>
14
15struct foo : boost::base_from_member<int&>
16{
17 explicit foo(int& ref) : boost::base_from_member<int&>(ref)
18 {
19 BOOST_TEST(&member == &ref);
20 }
21};
22
23int main()
24{
25 int i = 0;
26 foo f(i);
27
28 return boost::report_errors();
29}
30

source code of boost/libs/utility/base_from_member_ref_test.cpp