1
// boost utility/base_from_member.hpp header file --------------------------//
3
// (C) Copyright Daryle Walker 2001. Permission to copy, use, modify, sell
4
// and distribute this software is granted provided this copyright
5
// notice appears in all copies. This software is provided "as is" without
6
// express or implied warranty, and with no claim as to its suitability for
9
// See http://www.boost.org for most recent version including documentation.
11
#ifndef BOOST_UTILITY_BASE_FROM_MEMBER_HPP
12
#define BOOST_UTILITY_BASE_FROM_MEMBER_HPP
14
#include <boost/utility_fwd.hpp> // required for parameter defaults
20
// Base-from-member class template -----------------------------------------//
22
// Helper to initialize a base object so a derived class can use this
23
// object in the initialization of another base class. Used by
24
// Dietmar Kuehl from ideas by Ron Klatcho to solve the problem of a
25
// base class needing to be initialized by a member.
27
// Contributed by Daryle Walker
29
template < typename MemberType, int UniqueID >
30
class base_from_member
35
explicit base_from_member()
39
template< typename T1 >
40
explicit base_from_member( T1 x1 )
44
template< typename T1, typename T2 >
45
base_from_member( T1 x1, T2 x2 )
49
template< typename T1, typename T2, typename T3 >
50
base_from_member( T1 x1, T2 x2, T3 x3 )
51
: member( x1, x2, x3 )
54
}; // boost::base_from_member
59
#endif // BOOST_UTILITY_BASE_FROM_MEMBER_HPP