$extrastylesheet
Olena
User documentation 2.1
An Image Processing Platform
Milena
Getting started
API Reference Manual
All Classes
Examples
Demos
Publications
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
builtin.cc
1
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
2
//
3
// This file is part of Olena.
4
//
5
// Olena is free software: you can redistribute it and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, version 2 of the License.
8
//
9
// Olena is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
// General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with Olena. If not, see <http://www.gnu.org/licenses/>.
16
//
17
// As a special exception, you may use this file as part of a free
18
// software project without restriction. Specifically, if other files
19
// instantiate templates or use macros or inline functions from this
20
// file, or you compile this file and link it with other files to produce
21
// an executable, this file does not by itself cause the resulting
22
// executable to be covered by the GNU General Public License. This
23
// exception does not however invalidate any other reasons why the
24
// executable file might be covered by the GNU General Public License.
25
26
#include <iostream>
27
28
#include <mln/value/scalar.hh>
29
#include <mln/value/int_u8.hh>
30
31
32
namespace
mln
33
{
34
namespace
trait
35
{
36
37
namespace
op
38
{
39
40
template
<
typename
T>
41
struct
test
;
42
43
template
<
typename
L,
typename
R>
44
struct
test_2;
45
46
}
47
48
// unary
49
50
template
<
typename
S >
51
struct
set_unary_< op::
test
,
mln::value::Scalar
, S >
52
{
53
typedef
double
ret
;
54
};
55
56
// FIXME: Dead code?
57
// template <typename I>
58
// struct set_unary_< op::test,
59
// mln::value::Integer, I >
60
// {
61
// typedef float ret;
62
// };
63
64
// template <typename I>
65
// struct set_unary_< op::test,
66
// mln::value::Built_In, I >
67
// {
68
// typedef bool ret;
69
// };
70
71
72
// binary
73
74
template
<
typename
S1,
typename
S2 >
75
struct
set_binary_< op::test_2,
76
mln::value::Scalar
, S1,
77
mln::value::Scalar
, S2 >
78
{
79
typedef
double
ret
;
80
};
81
82
// FIXME: Dead code?
83
// template < typename I, typename S >
84
// struct set_binary_< op::test_2,
85
// mln::value::Integer, I,
86
// mln::value::Scalar, S >
87
// {
88
// typedef float ret;
89
// };
90
91
// template < typename B, typename S >
92
// struct set_binary_< op::test_2,
93
// mln::value::Built_In, B,
94
// mln::value::Scalar, S >
95
// {
96
// typedef bool ret;
97
// };
98
99
}
100
}
101
102
103
int
main()
104
{
105
using namespace
mln;
106
107
{
108
mln::trait::solve_binary< trait::op::test_2, int, value::scalar_< value::int_u8 >
>
::ret
tmp;
109
double
& d = tmp;
110
// Avoid a warning about unused variable D.
111
d = d;
112
}
113
{
114
mln::trait::solve_unary< trait::op::test, int >::ret
tmp;
115
double
& d = tmp;
116
// Avoid a warning about unused variable D.
117
d = d;
118
}
119
}
tests
value
builtin
builtin.cc
Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)