Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
1fc2e3b2
Commit
1fc2e3b2
authored
Aug 21, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
option => optional
this patch renames `optional` to `optional` in advance of porting libcppa to boost
parent
60429ff3
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
68 additions
and
68 deletions
+68
-68
cppa.files
cppa.files
+1
-1
cppa/cppa_fwd.hpp
cppa/cppa_fwd.hpp
+1
-1
cppa/detail/behavior_stack.hpp
cppa/detail/behavior_stack.hpp
+2
-2
cppa/detail/opt_impls.hpp
cppa/detail/opt_impls.hpp
+5
-5
cppa/detail/projection.hpp
cppa/detail/projection.hpp
+3
-3
cppa/detail/tdata.hpp
cppa/detail/tdata.hpp
+1
-1
cppa/detail/tuple_cast_impl.hpp
cppa/detail/tuple_cast_impl.hpp
+3
-3
cppa/guard_expr.hpp
cppa/guard_expr.hpp
+3
-3
cppa/io/acceptor.hpp
cppa/io/acceptor.hpp
+2
-2
cppa/io/ipv4_acceptor.hpp
cppa/io/ipv4_acceptor.hpp
+1
-1
cppa/match_expr.hpp
cppa/match_expr.hpp
+2
-2
cppa/opencl.hpp
cppa/opencl.hpp
+2
-2
cppa/opencl/actor_facade.hpp
cppa/opencl/actor_facade.hpp
+1
-1
cppa/opt.hpp
cppa/opt.hpp
+2
-2
cppa/optional.hpp
cppa/optional.hpp
+22
-22
cppa/tuple_cast.hpp
cppa/tuple_cast.hpp
+3
-3
cppa/util/type_traits.hpp
cppa/util/type_traits.hpp
+2
-2
examples/opencl/proper_matrix.cpp
examples/opencl/proper_matrix.cpp
+1
-1
examples/remote_actors/distributed_calculator.cpp
examples/remote_actors/distributed_calculator.cpp
+1
-1
src/behavior_stack.cpp
src/behavior_stack.cpp
+1
-1
src/broker.cpp
src/broker.cpp
+1
-1
src/default_peer_acceptor.cpp
src/default_peer_acceptor.cpp
+1
-1
src/ipv4_acceptor.cpp
src/ipv4_acceptor.cpp
+1
-1
src/opt.cpp
src/opt.cpp
+1
-1
unit_testing/test_match.cpp
unit_testing/test_match.cpp
+2
-2
unit_testing/test_opencl.cpp
unit_testing/test_opencl.cpp
+1
-1
unit_testing/test_tuple.cpp
unit_testing/test_tuple.cpp
+2
-2
No files found.
cppa.files
View file @
1fc2e3b2
...
...
@@ -124,7 +124,7 @@ cppa/opencl/opencl_metainfo.hpp
cppa/opencl/program.hpp
cppa/opencl/smart_ptr.hpp
cppa/opt.hpp
cppa/option.hpp
cppa/option
al
.hpp
cppa/optional_variant.hpp
cppa/partial_function.hpp
cppa/primitive_type.hpp
...
...
cppa/cppa_fwd.hpp
View file @
1fc2e3b2
...
...
@@ -56,7 +56,7 @@ enum primitive_type : unsigned char;
enum
class
atom_value
:
std
::
uint64_t
;
// class templates
template
<
typename
>
class
option
;
template
<
typename
>
class
option
al
;
template
<
typename
>
class
intrusive_ptr
;
// typedefs
...
...
cppa/detail/behavior_stack.hpp
View file @
1fc2e3b2
...
...
@@ -36,7 +36,7 @@
#include <utility>
#include <algorithm>
#include "cppa/option.hpp"
#include "cppa/option
al
.hpp"
#include "cppa/config.hpp"
#include "cppa/behavior.hpp"
#include "cppa/message_id.hpp"
...
...
@@ -61,7 +61,7 @@ class behavior_stack
behavior_stack
()
=
default
;
// @pre expected_response.valid()
option
<
behavior
&>
sync_handler
(
message_id
expected_response
);
option
al
<
behavior
&>
sync_handler
(
message_id
expected_response
);
// erases the last asynchronous message handler
void
pop_async_back
();
...
...
cppa/detail/opt_impls.hpp
View file @
1fc2e3b2
...
...
@@ -34,7 +34,7 @@
#include <sstream>
#include "cppa/on.hpp"
#include "cppa/option.hpp"
#include "cppa/option
al
.hpp"
// this header contains implementation details for opt.hpp
...
...
@@ -42,7 +42,7 @@ namespace cppa { namespace detail {
template
<
typename
T
>
struct
conv_arg_impl
{
typedef
option
<
T
>
result_type
;
typedef
option
al
<
T
>
result_type
;
static
inline
result_type
_
(
const
std
::
string
&
arg
)
{
std
::
istringstream
iss
(
arg
);
T
result
;
...
...
@@ -55,7 +55,7 @@ struct conv_arg_impl {
template
<
>
struct
conv_arg_impl
<
std
::
string
>
{
typedef
option
<
std
::
string
>
result_type
;
typedef
option
al
<
std
::
string
>
result_type
;
static
inline
result_type
_
(
const
std
::
string
&
arg
)
{
return
arg
;
}
};
...
...
@@ -165,7 +165,7 @@ class opt1_rvalue_builder {
.
when
(
cppa
::
placeholders
::
_x1
.
in
(
std
::
vector
<
std
::
string
>
())))
left_type
;
typedef
decltype
(
on
(
std
::
function
<
option
<
std
::
string
>
(
const
std
::
string
&
)
>
()))
typedef
decltype
(
on
(
std
::
function
<
option
al
<
std
::
string
>
(
const
std
::
string
&
)
>
()))
right_type
;
template
<
typename
Left
,
typename
Right
>
...
...
@@ -203,7 +203,7 @@ class opt1_rvalue_builder<false> {
public:
typedef
decltype
(
on
(
std
::
function
<
option
<
std
::
string
>
(
const
std
::
string
&
)
>
()))
typedef
decltype
(
on
(
std
::
function
<
option
al
<
std
::
string
>
(
const
std
::
string
&
)
>
()))
sub_type
;
template
<
typename
SubType
>
...
...
cppa/detail/projection.hpp
View file @
1fc2e3b2
...
...
@@ -31,7 +31,7 @@
#ifndef CPPA_PROJECTION_HPP
#define CPPA_PROJECTION_HPP
#include "cppa/option.hpp"
#include "cppa/option
al
.hpp"
#include "cppa/guard_expr.hpp"
#include "cppa/util/call.hpp"
...
...
@@ -56,7 +56,7 @@ struct collected_args_tuple {
typename
util
::
tl_map
<
ProjectionFuns
,
util
::
map_to_result_type
,
util
::
rm_option
util
::
rm_option
al
>::
type
,
typename
util
::
tl_map
<
util
::
type_list
<
Ts
...
>
,
...
...
@@ -142,7 +142,7 @@ class projection {
}
template
<
class
Storage
>
static
inline
bool
store
(
Storage
&
storage
,
option
<
Storage
>&&
value
)
{
static
inline
bool
store
(
Storage
&
storage
,
option
al
<
Storage
>&&
value
)
{
if
(
value
)
{
storage
=
std
::
move
(
*
value
);
return
true
;
...
...
cppa/detail/tdata.hpp
View file @
1fc2e3b2
...
...
@@ -36,7 +36,7 @@
#include <type_traits>
#include "cppa/get.hpp"
#include "cppa/option.hpp"
#include "cppa/option
al
.hpp"
#include "cppa/util/wrapped.hpp"
#include "cppa/util/type_list.hpp"
...
...
cppa/detail/tuple_cast_impl.hpp
View file @
1fc2e3b2
...
...
@@ -56,7 +56,7 @@ struct tuple_cast_impl {
static_cast
<
size_t
>
(
util
::
tl_find
<
util
::
type_list
<
T
...
>
,
anything
>::
value
);
typedef
util
::
limited_vector
<
size_t
,
size
>
mapping_vector
;
static
inline
option
<
Result
>
safe
(
any_tuple
&
tup
)
{
static
inline
option
al
<
Result
>
safe
(
any_tuple
&
tup
)
{
mapping_vector
mv
;
if
(
matches
<
T
...
>
(
tup
,
mv
))
return
{
Result
::
from
(
std
::
move
(
tup
.
vals
()),
mv
)};
...
...
@@ -66,7 +66,7 @@ struct tuple_cast_impl {
template
<
class
Result
,
typename
...
T
>
struct
tuple_cast_impl
<
wildcard_position
::
nil
,
Result
,
T
...
>
{
static
inline
option
<
Result
>
safe
(
any_tuple
&
tup
)
{
static
inline
option
al
<
Result
>
safe
(
any_tuple
&
tup
)
{
if
(
matches
<
T
...
>
(
tup
))
return
{
Result
::
from
(
std
::
move
(
tup
.
vals
()))};
return
{};
}
...
...
@@ -79,7 +79,7 @@ struct tuple_cast_impl<wildcard_position::trailing, Result, T...>
template
<
class
Result
,
typename
...
T
>
struct
tuple_cast_impl
<
wildcard_position
::
leading
,
Result
,
T
...
>
{
static
inline
option
<
Result
>
safe
(
any_tuple
&
tup
)
{
static
inline
option
al
<
Result
>
safe
(
any_tuple
&
tup
)
{
size_t
o
=
tup
.
size
()
-
(
sizeof
...(
T
)
-
1
);
if
(
matches
<
T
...
>
(
tup
))
return
{
Result
::
offset_subtuple
(
tup
.
vals
(),
o
)};
return
{};
...
...
cppa/guard_expr.hpp
View file @
1fc2e3b2
...
...
@@ -38,7 +38,7 @@
#include <type_traits>
#include "cppa/config.hpp"
#include "cppa/option.hpp"
#include "cppa/option
al
.hpp"
#include "cppa/util/call.hpp"
#include "cppa/util/void_type.hpp"
...
...
@@ -212,7 +212,7 @@ struct ge_get_front {
decltype
(
what
.
front
())
>::
value
>::
type
*
=
0
)
const
->
option
<
->
option
al
<
std
::
reference_wrapper
<
const
typename
util
::
rm_const_and_ref
<
decltype
(
what
.
front
())
>::
type
>
>
{
if
(
what
.
empty
()
==
false
)
return
{
what
.
front
()};
...
...
@@ -225,7 +225,7 @@ struct ge_get_front {
decltype
(
what
.
front
())
>::
value
==
false
>::
type
*
=
0
)
const
->
option
<
decltype
(
what
.
front
())
>
{
->
option
al
<
decltype
(
what
.
front
())
>
{
if
(
what
.
empty
()
==
false
)
return
{
what
.
front
()};
return
{};
}
...
...
cppa/io/acceptor.hpp
View file @
1fc2e3b2
...
...
@@ -34,7 +34,7 @@
#include <memory>
#include "cppa/config.hpp"
#include "cppa/option.hpp"
#include "cppa/option
al
.hpp"
#include "cppa/io/input_stream.hpp"
#include "cppa/io/output_stream.hpp"
...
...
@@ -71,7 +71,7 @@ class acceptor {
* @brief Tries to accept a new connection but immediately returns if
* there is no pending connection.
*/
virtual
option
<
stream_ptr_pair
>
try_accept_connection
()
=
0
;
virtual
option
al
<
stream_ptr_pair
>
try_accept_connection
()
=
0
;
};
...
...
cppa/io/ipv4_acceptor.hpp
View file @
1fc2e3b2
...
...
@@ -52,7 +52,7 @@ class ipv4_acceptor : public acceptor {
stream_ptr_pair
accept_connection
();
option
<
stream_ptr_pair
>
try_accept_connection
();
option
al
<
stream_ptr_pair
>
try_accept_connection
();
private:
...
...
cppa/match_expr.hpp
View file @
1fc2e3b2
...
...
@@ -31,7 +31,7 @@
#ifndef CPPA_MATCH_EXPR_HPP
#define CPPA_MATCH_EXPR_HPP
#include "cppa/option.hpp"
#include "cppa/option
al
.hpp"
#include "cppa/guard_expr.hpp"
#include "cppa/tpartial_function.hpp"
...
...
@@ -402,7 +402,7 @@ struct get_case_ {
typename
util
::
tl_map
<
padded_transformers
,
util
::
map_to_result_type
,
util
::
rm_option
,
util
::
rm_option
al
,
std
::
add_lvalue_reference
>::
type
,
typename
util
::
tl_zip
<
...
...
cppa/opencl.hpp
View file @
1fc2e3b2
...
...
@@ -34,7 +34,7 @@
#include <algorithm>
#include <functional>
#include "cppa/option.hpp"
#include "cppa/option
al
.hpp"
#include "cppa/cow_tuple.hpp"
#include "cppa/util/call.hpp"
...
...
@@ -104,7 +104,7 @@ struct cl_spawn_helper<R (Ts...), void> {
};
template
<
typename
R
,
typename
...
Ts
>
struct
cl_spawn_helper
<
std
::
function
<
option
<
cow_tuple
<
Ts
...
>>
(
any_tuple
)
>
,
struct
cl_spawn_helper
<
std
::
function
<
option
al
<
cow_tuple
<
Ts
...
>>
(
any_tuple
)
>
,
std
::
function
<
any_tuple
(
R
&
)
>>
:
cl_spawn_helper
<
R
(
Ts
...)
>
{
};
...
...
cppa/opencl/actor_facade.hpp
View file @
1fc2e3b2
...
...
@@ -70,7 +70,7 @@ class actor_facade<Ret(Args...)> : public actor {
public:
typedef
cow_tuple
<
typename
util
::
rm_const_and_ref
<
Args
>::
type
...
>
args_tuple
;
typedef
std
::
function
<
option
<
args_tuple
>
(
any_tuple
)
>
arg_mapping
;
typedef
std
::
function
<
option
al
<
args_tuple
>
(
any_tuple
)
>
arg_mapping
;
typedef
std
::
function
<
any_tuple
(
Ret
&
)
>
result_mapping
;
static
intrusive_ptr
<
actor_facade
>
create
(
const
program
&
prog
,
...
...
cppa/opt.hpp
View file @
1fc2e3b2
...
...
@@ -38,14 +38,14 @@
#include <functional>
#include "cppa/on.hpp"
#include "cppa/option.hpp"
#include "cppa/option
al
.hpp"
#include "cppa/detail/demangle.hpp"
#include "cppa/detail/opt_impls.hpp"
namespace
cppa
{
//template<typename T>
//option<T> conv_arg(const std::string& arg) {
//option
al
<T> conv_arg(const std::string& arg) {
// return detail::conv_arg_impl<T>::_(arg);
//}
...
...
cppa/option.hpp
→
cppa/option
al
.hpp
View file @
1fc2e3b2
...
...
@@ -41,7 +41,7 @@ namespace cppa {
* @brief Represents an optional value of @p T.
*/
template
<
typename
T
>
class
option
{
class
option
al
{
public:
...
...
@@ -54,32 +54,32 @@ class option {
* @brief Default constructor.
* @post <tt>valid() == false</tt>
*/
option
()
:
m_valid
(
false
)
{
}
option
al
()
:
m_valid
(
false
)
{
}
/**
* @brief Creates an @p option from @p value.
* @post <tt>valid() == true</tt>
*/
option
(
T
value
)
:
m_valid
(
false
)
{
cr
(
std
::
move
(
value
));
}
option
al
(
T
value
)
:
m_valid
(
false
)
{
cr
(
std
::
move
(
value
));
}
template
<
typename
T0
,
typename
T1
,
typename
...
Ts
>
option
(
T0
&&
arg0
,
T1
&&
arg1
,
Ts
&&
...
args
)
:
m_valid
(
false
)
{
option
al
(
T0
&&
arg0
,
T1
&&
arg1
,
Ts
&&
...
args
)
:
m_valid
(
false
)
{
cr
(
T
(
std
::
forward
<
T0
>
(
arg0
),
std
::
forward
<
T1
>
(
arg1
),
std
::
forward
<
Ts
>
(
args
)...));
}
option
(
const
option
&
other
)
:
m_valid
(
false
)
{
option
al
(
const
optional
&
other
)
:
m_valid
(
false
)
{
if
(
other
.
m_valid
)
cr
(
other
.
m_value
);
}
option
(
option
&&
other
)
:
m_valid
(
false
)
{
option
al
(
optional
&&
other
)
:
m_valid
(
false
)
{
if
(
other
.
m_valid
)
cr
(
std
::
move
(
other
.
m_value
));
}
~
option
()
{
destroy
();
}
~
option
al
()
{
destroy
();
}
option
&
operator
=
(
const
option
&
other
)
{
option
al
&
operator
=
(
const
optional
&
other
)
{
if
(
m_valid
)
{
if
(
other
.
m_valid
)
m_value
=
other
.
m_value
;
else
destroy
();
...
...
@@ -90,7 +90,7 @@ class option {
return
*
this
;
}
option
&
operator
=
(
option
&&
other
)
{
option
al
&
operator
=
(
optional
&&
other
)
{
if
(
m_valid
)
{
if
(
other
.
m_valid
)
m_value
=
std
::
move
(
other
.
m_value
);
else
destroy
();
...
...
@@ -186,19 +186,19 @@ class option {
};
template
<
typename
T
>
class
option
<
T
&>
{
class
option
al
<
T
&>
{
public:
typedef
T
type
;
option
()
:
m_value
(
nullptr
)
{
}
option
al
()
:
m_value
(
nullptr
)
{
}
option
(
T
&
value
)
:
m_value
(
&
value
)
{
}
option
al
(
T
&
value
)
:
m_value
(
&
value
)
{
}
option
(
const
option
&
other
)
=
default
;
option
al
(
const
optional
&
other
)
=
default
;
option
&
operator
=
(
const
option
&
other
)
=
default
;
option
al
&
operator
=
(
const
optional
&
other
)
=
default
;
inline
bool
valid
()
const
{
return
m_value
!=
nullptr
;
}
...
...
@@ -241,46 +241,46 @@ class option<T&> {
/** @relates option */
template
<
typename
T
>
struct
is_option
{
static
constexpr
bool
value
=
false
;
};
struct
is_option
al
{
static
constexpr
bool
value
=
false
;
};
template
<
typename
T
>
struct
is_option
<
option
<
T
>>
{
static
constexpr
bool
value
=
true
;
};
struct
is_option
al
<
optional
<
T
>>
{
static
constexpr
bool
value
=
true
;
};
/** @relates option */
template
<
typename
T
,
typename
U
>
bool
operator
==
(
const
option
<
T
>&
lhs
,
const
option
<
U
>&
rhs
)
{
bool
operator
==
(
const
option
al
<
T
>&
lhs
,
const
optional
<
U
>&
rhs
)
{
if
((
lhs
)
&&
(
rhs
))
return
*
lhs
==
*
rhs
;
return
false
;
}
/** @relates option */
template
<
typename
T
,
typename
U
>
bool
operator
==
(
const
option
<
T
>&
lhs
,
const
U
&
rhs
)
{
bool
operator
==
(
const
option
al
<
T
>&
lhs
,
const
U
&
rhs
)
{
if
(
lhs
)
return
*
lhs
==
rhs
;
return
false
;
}
/** @relates option */
template
<
typename
T
,
typename
U
>
bool
operator
==
(
const
T
&
lhs
,
const
option
<
U
>&
rhs
)
{
bool
operator
==
(
const
T
&
lhs
,
const
option
al
<
U
>&
rhs
)
{
return
rhs
==
lhs
;
}
/** @relates option */
template
<
typename
T
,
typename
U
>
bool
operator
!=
(
const
option
<
T
>&
lhs
,
const
option
<
U
>&
rhs
)
{
bool
operator
!=
(
const
option
al
<
T
>&
lhs
,
const
optional
<
U
>&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
/** @relates option */
template
<
typename
T
,
typename
U
>
bool
operator
!=
(
const
option
<
T
>&
lhs
,
const
U
&
rhs
)
{
bool
operator
!=
(
const
option
al
<
T
>&
lhs
,
const
U
&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
/** @relates option */
template
<
typename
T
,
typename
U
>
bool
operator
!=
(
const
T
&
lhs
,
const
option
<
U
>&
rhs
)
{
bool
operator
!=
(
const
T
&
lhs
,
const
option
al
<
U
>&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
...
...
cppa/tuple_cast.hpp
View file @
1fc2e3b2
...
...
@@ -33,7 +33,7 @@
#include <type_traits>
#include "cppa/option.hpp"
#include "cppa/option
al
.hpp"
#include "cppa/util/type_list.hpp"
...
...
@@ -90,7 +90,7 @@ auto tuple_cast(any_tuple tup, const util::type_list<T...>&);
template
<
typename
...
T
>
auto
moving_tuple_cast
(
any_tuple
&
tup
)
->
option
<
->
option
al
<
typename
cow_tuple_from_type_list
<
typename
util
::
tl_filter_not
<
util
::
type_list
<
T
...
>
,
is_anything
>::
type
...
...
@@ -110,7 +110,7 @@ auto moving_tuple_cast(any_tuple& tup, const util::type_list<T...>&)
template
<
typename
...
T
>
auto
tuple_cast
(
any_tuple
tup
)
->
option
<
->
option
al
<
typename
cow_tuple_from_type_list
<
typename
util
::
tl_filter_not
<
util
::
type_list
<
T
...
>
,
is_anything
>::
type
...
...
cppa/util/type_traits.hpp
View file @
1fc2e3b2
...
...
@@ -302,12 +302,12 @@ struct is_mutable_ref {
* @brief Returns either @p T or @p T::type if @p T is an option.
*/
template
<
typename
T
>
struct
rm_option
{
struct
rm_option
al
{
typedef
T
type
;
};
template
<
typename
T
>
struct
rm_option
<
option
<
T
>
>
{
struct
rm_option
al
<
optional
<
T
>
>
{
typedef
T
type
;
};
...
...
examples/opencl/proper_matrix.cpp
View file @
1fc2e3b2
...
...
@@ -162,7 +162,7 @@ void multiplier() {
// to a tuple of vectors; note that this function returns
// an option (an empty results causes the actor to ignore
// the message)
[]
(
any_tuple
msg
)
->
option
<
cow_tuple
<
fvec
,
fvec
>>
{
[]
(
any_tuple
msg
)
->
option
al
<
cow_tuple
<
fvec
,
fvec
>>
{
auto
opt
=
tuple_cast
<
matrix_type
,
matrix_type
>
(
msg
);
if
(
opt
)
{
return
{
move
(
get_ref
<
0
>
(
*
opt
).
data
()),
...
...
examples/remote_actors/distributed_calculator.cpp
View file @
1fc2e3b2
...
...
@@ -140,7 +140,7 @@ void client_repl(const string& host, uint16_t port) {
);
}
else
{
auto
toint
=
[](
const
string
&
str
)
->
option
<
int
>
{
auto
toint
=
[](
const
string
&
str
)
->
option
al
<
int
>
{
try
{
return
{
std
::
stoi
(
str
)};
}
catch
(
std
::
exception
&
)
{
aout
<<
"
\"
"
<<
str
<<
"
\"
is not an integer"
<<
endl
;
...
...
src/behavior_stack.cpp
View file @
1fc2e3b2
...
...
@@ -62,7 +62,7 @@ struct behavior_stack_mover : iterator<output_iterator_tag, void, void, void, vo
inline
behavior_stack_mover
move_iter
(
behavior_stack
*
bs
)
{
return
{
bs
};
}
option
<
behavior
&>
behavior_stack
::
sync_handler
(
message_id
expected_response
)
{
option
al
<
behavior
&>
behavior_stack
::
sync_handler
(
message_id
expected_response
)
{
if
(
expected_response
.
valid
())
{
auto
e
=
m_elements
.
rend
();
auto
i
=
find_if
(
m_elements
.
rbegin
(),
e
,
[
=
](
element_type
&
val
)
{
...
...
src/broker.cpp
View file @
1fc2e3b2
...
...
@@ -258,7 +258,7 @@ class broker::doorman : public broker::servant {
continue_reading_result
continue_reading
()
override
{
CPPA_LOG_TRACE
(
""
);
for
(;;)
{
option
<
stream_ptr_pair
>
opt
;
option
al
<
stream_ptr_pair
>
opt
;
try
{
opt
=
m_ptr
->
try_accept_connection
();
}
catch
(
std
::
exception
&
e
)
{
CPPA_LOG_ERROR
(
to_verbose_string
(
e
));
...
...
src/default_peer_acceptor.cpp
View file @
1fc2e3b2
...
...
@@ -53,7 +53,7 @@ default_peer_acceptor::default_peer_acceptor(default_protocol* parent,
continue_reading_result
default_peer_acceptor
::
continue_reading
()
{
CPPA_LOG_TRACE
(
""
);
for
(;;)
{
option
<
stream_ptr_pair
>
opt
;
option
al
<
stream_ptr_pair
>
opt
;
try
{
opt
=
m_ptr
->
try_accept_connection
();
}
catch
(
exception
&
e
)
{
CPPA_LOG_ERROR
(
to_verbose_string
(
e
));
...
...
src/ipv4_acceptor.cpp
View file @
1fc2e3b2
...
...
@@ -162,7 +162,7 @@ stream_ptr_pair ipv4_acceptor::accept_connection() {
return
result
;
}
option
<
stream_ptr_pair
>
ipv4_acceptor
::
try_accept_connection
()
{
option
al
<
stream_ptr_pair
>
ipv4_acceptor
::
try_accept_connection
()
{
if
(
!
m_is_nonblocking
)
{
nonblocking
(
m_fd
,
true
);
m_is_nonblocking
=
true
;
...
...
src/opt.cpp
View file @
1fc2e3b2
...
...
@@ -51,7 +51,7 @@ detail::opt1_rvalue_builder<true> on_opt1(char short_opt,
string
prefix
=
"--"
;
prefix
+=
long_opt
;
prefix
+=
"="
;
function
<
option
<
string
>
(
const
string
&
)
>
kvp
=
[
prefix
](
const
string
&
input
)
->
option
<
string
>
{
function
<
option
al
<
string
>
(
const
string
&
)
>
kvp
=
[
prefix
](
const
string
&
input
)
->
optional
<
string
>
{
if
(
equal
(
begin
(
prefix
),
end
(
prefix
),
begin
(
input
)))
{
return
input
.
substr
(
prefix
.
size
());
}
...
...
unit_testing/test_match.cpp
View file @
1fc2e3b2
...
...
@@ -284,7 +284,7 @@ int main() {
CPPA_CHECK
(
invoked
);
invoked
=
false
;
auto
toint
=
[](
const
string
&
str
)
->
option
<
int
>
{
auto
toint
=
[](
const
string
&
str
)
->
option
al
<
int
>
{
char
*
endptr
=
nullptr
;
int
result
=
static_cast
<
int
>
(
strtol
(
str
.
c_str
(),
&
endptr
,
10
));
if
(
endptr
!=
nullptr
&&
*
endptr
==
'\0'
)
{
...
...
@@ -425,7 +425,7 @@ int main() {
);
CPPA_CHECK_EQUAL
(
success
,
true
);
auto
extract_name
=
[](
const
string
&
kvp
)
->
option
<
string
>
{
auto
extract_name
=
[](
const
string
&
kvp
)
->
option
al
<
string
>
{
auto
vec
=
split
(
kvp
,
'='
);
if
(
vec
.
size
()
==
2
)
{
if
(
vec
.
front
()
==
"--name"
)
{
...
...
unit_testing/test_opencl.cpp
View file @
1fc2e3b2
...
...
@@ -140,7 +140,7 @@ int main() {
const
matrix_type
expected2
(
move
(
expected1
));
auto
map_args
=
[]
(
any_tuple
msg
)
->
option
<
cow_tuple
<
ivec
>>
{
auto
map_args
=
[]
(
any_tuple
msg
)
->
option
al
<
cow_tuple
<
ivec
>>
{
auto
opt
=
tuple_cast
<
matrix_type
>
(
msg
);
if
(
opt
)
{
return
{
make_cow_tuple
(
move
(
get_ref
<
0
>
(
*
opt
).
data
()))};
...
...
unit_testing/test_tuple.cpp
View file @
1fc2e3b2
...
...
@@ -66,7 +66,7 @@ std::string int2str(int i) {
return
std
::
to_string
(
i
);
}
option
<
int
>
str2int
(
const
std
::
string
&
str
)
{
option
al
<
int
>
str2int
(
const
std
::
string
&
str
)
{
char
*
endptr
=
nullptr
;
int
result
=
static_cast
<
int
>
(
strtol
(
str
.
c_str
(),
&
endptr
,
10
));
if
(
endptr
!=
nullptr
&&
*
endptr
==
'\0'
)
{
...
...
@@ -336,7 +336,7 @@ void check_wildcards() {
// use tuple cast to get a subtuple
any_tuple
at0
(
t0
);
auto
v0opt
=
tuple_cast
<
std
::
string
,
anything
>
(
at0
);
CPPA_CHECK
((
std
::
is_same
<
decltype
(
v0opt
),
option
<
cow_tuple
<
std
::
string
>>>::
value
));
CPPA_CHECK
((
std
::
is_same
<
decltype
(
v0opt
),
option
al
<
cow_tuple
<
std
::
string
>>>::
value
));
CPPA_CHECK
((
v0opt
));
CPPA_CHECK
(
at0
.
size
()
==
2
&&
at0
.
at
(
0
)
==
&
get
<
0
>
(
t0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment