blob: 4d05f9f52cb42fef9334ec573c2b12db4199d84b [file] [log] [blame]
Jeff Thompsonef2d5a42013-08-22 19:09:24 -07001// -- operator_actions.hpp - Boost Lambda Library ----------------------
2
3// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
4//
5// Distributed under the Boost Software License, Version 1.0. (See
6// accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8
9// For more information, see http://lambda.cs.utu.fi
10
Jeff Thompson3d613fd2013-10-15 15:39:04 -070011#ifndef NDNBOOST_LAMBDA_OPERATOR_ACTIONS_HPP
12#define NDNBOOST_LAMBDA_OPERATOR_ACTIONS_HPP
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070013
14namespace ndnboost {
15namespace lambda {
16
17
18// -- artihmetic ----------------------
19
20class plus_action {};
21class minus_action {};
22class multiply_action {};
23class divide_action {};
24class remainder_action {};
25
26// -- bitwise -------------------
27
28class leftshift_action {};
29class rightshift_action {};
30class xor_action {};
31
32
33// -- bitwise/logical -------------------
34
35class and_action {};
36class or_action {};
37class not_action {};
38
39// -- relational -------------------------
40
41class less_action {};
42class greater_action {};
43class lessorequal_action {};
44class greaterorequal_action {};
45class equal_action {};
46class notequal_action {};
47
48// -- increment/decrement ------------------------------
49
50class increment_action {};
51class decrement_action {};
52
53// -- void return ------------------------------
54
55// -- other ------------------------------
56
57class addressof_action {};
58 // class comma_action {}; // defined in actions.hpp
59class contentsof_action {};
60// class member_pointer_action {}; (defined in member_ptr.hpp)
61
62
63// -- actioun group templates --------------------
64
65template <class Action> class arithmetic_action;
66template <class Action> class bitwise_action;
67template <class Action> class logical_action;
68template <class Action> class relational_action;
69template <class Action> class arithmetic_assignment_action;
70template <class Action> class bitwise_assignment_action;
71template <class Action> class unary_arithmetic_action;
72template <class Action> class pre_increment_decrement_action;
73template <class Action> class post_increment_decrement_action;
74
75// ---------------------------------------------------------
76
77 // actions, for which the existence of protect is checked in return type
78 // deduction.
79
80template <class Act> struct is_protectable<arithmetic_action<Act> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070081 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070082};
83template <class Act> struct is_protectable<bitwise_action<Act> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070084 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070085};
86template <class Act> struct is_protectable<logical_action<Act> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070087 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070088};
89template <class Act> struct is_protectable<relational_action<Act> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070090 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070091};
92template <class Act>
93struct is_protectable<arithmetic_assignment_action<Act> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070094 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070095};
96template <class Act> struct is_protectable<bitwise_assignment_action<Act> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070097 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070098};
99template <class Act> struct is_protectable<unary_arithmetic_action<Act> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700100 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -0700101};
102template <class Act>
103struct is_protectable<pre_increment_decrement_action<Act> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700104 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -0700105};
106template <class Act> struct
107is_protectable<post_increment_decrement_action<Act> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700108 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -0700109};
110
111template <> struct is_protectable<other_action<addressof_action> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700112 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -0700113};
114template <> struct is_protectable<other_action<contentsof_action> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700115 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -0700116};
117
118template<> struct is_protectable<other_action<subscript_action> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700119 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -0700120};
121template<> struct is_protectable<other_action<assignment_action> > {
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700122 NDNBOOST_STATIC_CONSTANT(bool, value = true);
Jeff Thompsonef2d5a42013-08-22 19:09:24 -0700123};
124
125// NOTE: comma action is also protectable, but the specialization is
126 // in actions.hpp
127
128
129} // namespace lambda
130} // namespace ndnboost
131
132#endif
133
134
135
136
137
138
139