~ubuntu-branches/ubuntu/warty/aqsis/warty

« back to all changes in this revision

Viewing changes to boost/boost/utility/base_from_member.hpp

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:25:04 UTC
  • Revision ID: james.westby@ubuntu.com-20040824072504-zf993vnevvisdsvb
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  boost utility/base_from_member.hpp header file  --------------------------//
 
2
 
 
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
 
7
//  any purpose.
 
8
 
 
9
//  See http://www.boost.org for most recent version including documentation.
 
10
 
 
11
#ifndef BOOST_UTILITY_BASE_FROM_MEMBER_HPP
 
12
#define BOOST_UTILITY_BASE_FROM_MEMBER_HPP
 
13
 
 
14
#include <boost/utility_fwd.hpp>  // required for parameter defaults
 
15
 
 
16
 
 
17
namespace boost
 
18
{
 
19
 
 
20
//  Base-from-member class template  -----------------------------------------//
 
21
 
 
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.
 
26
 
 
27
// Contributed by Daryle Walker
 
28
 
 
29
template < typename MemberType, int UniqueID >
 
30
class base_from_member
 
31
{
 
32
protected:
 
33
    MemberType  member;
 
34
 
 
35
    explicit  base_from_member()
 
36
        : member()
 
37
        {}
 
38
 
 
39
    template< typename T1 >
 
40
    explicit base_from_member( T1 x1 )
 
41
        : member( x1 )
 
42
        {}
 
43
 
 
44
    template< typename T1, typename T2 >
 
45
    base_from_member( T1 x1, T2 x2 )
 
46
        : member( x1, x2 )
 
47
        {}
 
48
 
 
49
    template< typename T1, typename T2, typename T3 >
 
50
    base_from_member( T1 x1, T2 x2, T3 x3 )
 
51
        : member( x1, x2, x3 ) 
 
52
        {}
 
53
 
 
54
};  // boost::base_from_member
 
55
 
 
56
}  // namespace boost
 
57
 
 
58
 
 
59
#endif  // BOOST_UTILITY_BASE_FROM_MEMBER_HPP