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

« back to all changes in this revision

Viewing changes to boost/boost/mpl/minus.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
 
 
2
#ifndef BOOST_MPL_MINUS_HPP_INCLUDED
 
3
#define BOOST_MPL_MINUS_HPP_INCLUDED
 
4
 
 
5
// + file: boost/mpl/minus.hpp
 
6
// + last modified: 25/feb/03
 
7
 
 
8
// Copyright (c) 2000-03
 
9
// Aleksey Gurtovoy
 
10
//
 
11
// Permission to use, copy, modify, distribute and sell this software
 
12
// and its documentation for any purpose is hereby granted without fee, 
 
13
// provided that the above copyright notice appears in all copies and 
 
14
// that both the copyright notice and this permission notice appear in 
 
15
// supporting documentation. No representations are made about the 
 
16
// suitability of this software for any purpose. It is provided "as is" 
 
17
// without express or implied warranty.
 
18
//
 
19
// See http://www.boost.org/libs/mpl for documentation.
 
20
 
 
21
#include "boost/mpl/integral_c.hpp"
 
22
#include "boost/mpl/aux_/typeof.hpp"
 
23
#include "boost/mpl/aux_/value_wknd.hpp"
 
24
#include "boost/mpl/aux_/void_spec.hpp"
 
25
#include "boost/mpl/aux_/lambda_support.hpp"
 
26
#include "boost/config.hpp"
 
27
 
 
28
namespace boost {
 
29
namespace mpl {
 
30
 
 
31
template<
 
32
      typename T, T N1, T N2, T N3 = 0, T N4 = 0, T N5 = 0
 
33
    >
 
34
struct minus_c
 
35
{
 
36
    BOOST_STATIC_CONSTANT(T, value = (N1 - N2 - N3 - N4 - N5));
 
37
#if !defined(__BORLANDC__)
 
38
    typedef integral_c<T,value> type;
 
39
#else
 
40
    typedef integral_c<T,(N1 - N2 - N3 - N4 - N5)> type;
 
41
#endif
 
42
};
 
43
 
 
44
template<
 
45
      typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T1)
 
46
    , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T2)
 
47
    , typename T3 = integral_c<int,0>
 
48
    , typename T4 = integral_c<int,0>
 
49
    , typename T5 = integral_c<int,0>
 
50
    >
 
51
struct minus
 
52
    : minus_c<
 
53
          BOOST_MPL_AUX_TYPEOF(T1,
 
54
             T1::value - T2::value - T3::value - T4::value - T5::value
 
55
            )
 
56
        , BOOST_MPL_AUX_MSVC_VALUE_WKND(T1)::value
 
57
        , BOOST_MPL_AUX_MSVC_VALUE_WKND(T2)::value
 
58
        , BOOST_MPL_AUX_MSVC_VALUE_WKND(T3)::value
 
59
        , BOOST_MPL_AUX_MSVC_VALUE_WKND(T4)::value
 
60
        , BOOST_MPL_AUX_MSVC_VALUE_WKND(T5)::value
 
61
        >
 
62
{
 
63
    BOOST_MPL_AUX_LAMBDA_SUPPORT(5, minus, (T1,T2,T3,T4,T5))
 
64
};
 
65
 
 
66
BOOST_MPL_AUX_VOID_SPEC_EXT(2,5,minus)
 
67
 
 
68
} // namespace mpl
 
69
} // namespace boost
 
70
 
 
71
#endif // BOOST_MPL_MINUS_HPP_INCLUDED