cheshirekow
v0.1.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
rvalue.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3
*
4
* This file is part of fiber.
5
*
6
* fiber is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* fiber is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with fiber. If not, see <http://www.gnu.org/licenses/>.
18
*/
25
#ifndef FIBER_RVALUE_H_
26
#define FIBER_RVALUE_H_
27
28
29
namespace
fiber {
30
32
template
<
typename
Scalar,
class
Exp>
33
class
_RValue
{
34
public
:
35
Size
size
()
const
{
return
static_cast<
Exp const&
>
(*this).size(); }
36
Size
rows
()
const
{
return
static_cast<
Exp const&
>
(*this).rows(); }
37
Size
cols
()
const
{
return
static_cast<
Exp const&
>
(*this).cols(); }
38
39
Scalar
operator[]
(
Size
i)
const
{
40
return
static_cast<
Exp const&
>
(*this)[i];
41
}
42
43
Scalar
operator()
(
Size
i,
Size
j)
const
{
44
return
static_cast<
Exp const&
>
(*this)(i, j);
45
}
46
};
47
50
template
<
typename
Scalar,
class
Exp>
51
const
_RValue<Scalar, Exp>
&
RValue
(
const
_RValue<Scalar, Exp>
& exp) {
52
return
exp;
53
}
54
55
}
// namespace fiber
56
57
58
#endif // FIBER_RVALUE_H_
fiber::RValue
const _RValue< Scalar, Exp > & RValue(const _RValue< Scalar, Exp > &exp)
Explicitly expose _RValue of an expressions, can be used to help the compiler disambiguate overloads...
Definition:
rvalue.h:51
fiber::_RValue
expression template for rvalues
Definition:
rvalue.h:33
fiber::_RValue::cols
Size cols() const
Definition:
rvalue.h:37
fiber::Size
unsigned int Size
Definition:
fiber.h:32
fiber::_RValue::rows
Size rows() const
Definition:
rvalue.h:36
fiber::_RValue::operator[]
Scalar operator[](Size i) const
Definition:
rvalue.h:39
fiber::_RValue::operator()
Scalar operator()(Size i, Size j) const
Definition:
rvalue.h:43
fiber::_RValue::size
Size size() const
Definition:
rvalue.h:35
include
fiber
rvalue.h
Generated on Sun Mar 22 2015 22:47:43 for cheshirekow by
1.8.6