Thrill
0.1
no_operation.hpp
Go to the documentation of this file.
1
/*******************************************************************************
2
* tlx/meta/no_operation.hpp
3
*
4
* Part of tlx - http://panthema.net/tlx
5
*
6
* Copyright (C) 2015-2019 Timo Bingmann <
[email protected]
>
7
*
8
* All rights reserved. Published under the Boost Software License, Version 1.0
9
******************************************************************************/
10
11
#ifndef TLX_META_NO_OPERATION_HEADER
12
#define TLX_META_NO_OPERATION_HEADER
13
14
namespace
tlx
{
15
16
//! \addtogroup tlx_meta
17
//! \{
18
19
//! The noop functor, which takes any arguments and does nothing. This is a good
20
//! default argument for lambda function parameters.
21
template
<
typename
ReturnType>
22
class
NoOperation
23
{
24
public
:
25
explicit
NoOperation
(ReturnType return_value = ReturnType())
26
:
return_value_
(return_value) { }
27
28
ReturnType
operator ()
(...) const noexcept {
29
return
return_value_
;
30
}
31
32
protected
:
33
ReturnType
return_value_
;
34
};
35
36
//! Specialized noop functor which returns a void.
37
template
<>
38
class
NoOperation
<void>
39
{
40
public
:
41
void
operator ()
(...) const noexcept { }
42
};
43
44
//! \}
45
46
}
// namespace tlx
47
48
#endif // !TLX_META_NO_OPERATION_HEADER
49
50
/******************************************************************************/
tlx::NoOperation
Definition:
no_operation.hpp:22
tlx
Definition:
exclusive_scan.hpp:17
tlx::NoOperation::NoOperation
NoOperation(ReturnType return_value=ReturnType())
Definition:
no_operation.hpp:25
tlx::NoOperation::operator()
ReturnType operator()(...) const noexcept
Definition:
no_operation.hpp:28
tlx::NoOperation::return_value_
ReturnType return_value_
Definition:
no_operation.hpp:33
extlib
tlx
tlx
meta
no_operation.hpp
Generated on Mon Apr 6 2020 09:17:55 for Thrill by
1.8.13