Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
code
pfabric
Commits
cfda7a78
Commit
cfda7a78
authored
Jan 19, 2021
by
Philipp Götze
Browse files
Get rid of boost bind pragma message warning
parent
b71cce44
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/libcpp/utilities/BindVariadic.hpp
View file @
cfda7a78
...
...
@@ -29,8 +29,7 @@
#include
"libcpp/mpl/sequences/GenerateIndexes.hpp"
#include
<boost/bind.hpp>
#include
<boost/bind/bind.hpp>
namespace
ns_utilities
{
...
...
@@ -67,22 +66,22 @@ namespace impl {
* @return a function object for the bound function
*/
template
<
typename
ReturnType
,
class
ClassType
,
class
...
Args
,
int
...
Indexes
typename
ReturnType
,
class
ClassType
,
class
...
Args
,
int
...
Indexes
>
auto
bindVariadicImpl
(
ReturnType
(
ClassType
::*
memberFn
)
(
Args
...),
ClassType
*
instance
,
ns_mpl
::
IndexTuple
<
Indexes
...
>
indexes
)
->
decltype
(
boost
::
bind
(
memberFn
,
instance
,
boost
::
arg
<
Indexes
>
()...
)
)
ns_mpl
::
IndexTuple
<
Indexes
...
>
indexes
)
->
decltype
(
boost
::
bind
(
memberFn
,
instance
,
boost
::
arg
<
Indexes
>
()...
)
)
{
return
boost
::
bind
(
memberFn
,
instance
,
// generate a placeholder for each index in the Indexes list
// using parameter pack expansion
boost
::
arg
<
Indexes
>
()...
);
// generate a placeholder for each index in the Indexes list
// using parameter pack expansion
boost
::
arg
<
Indexes
>
()...
);
}
/**
...
...
@@ -107,22 +106,22 @@ auto bindVariadicImpl( ReturnType (ClassType::* memberFn) (Args...), ClassType*
* @return a function object for the bound function
*/
template
<
typename
ReturnType
,
class
ClassType
,
class
...
Args
,
int
...
Indexes
typename
ReturnType
,
class
ClassType
,
class
...
Args
,
int
...
Indexes
>
auto
bindVariadicImpl
(
ReturnType
(
ClassType
::*
memberFn
)
(
Args
...)
const
,
const
ClassType
*
instance
,
ns_mpl
::
IndexTuple
<
Indexes
...
>
indexes
)
->
decltype
(
boost
::
bind
(
memberFn
,
instance
,
boost
::
arg
<
Indexes
>
()...
)
)
ns_mpl
::
IndexTuple
<
Indexes
...
>
indexes
)
->
decltype
(
boost
::
bind
(
memberFn
,
instance
,
boost
::
arg
<
Indexes
>
()...
)
)
{
return
boost
::
bind
(
memberFn
,
instance
,
// generate a placeholder for each index in the Indexes list
// using parameter pack expansion
boost
::
arg
<
Indexes
>
()...
);
// generate a placeholder for each index in the Indexes list
// using parameter pack expansion
boost
::
arg
<
Indexes
>
()...
);
}
}
/* end namespace impl */
...
...
@@ -151,27 +150,27 @@ auto bindVariadicImpl( ReturnType (ClassType::* memberFn) (Args...) const, const
* @return a function object for the bound function
*/
template
<
typename
ReturnType
,
class
ClassType
,
typename
...
Args
typename
ReturnType
,
class
ClassType
,
typename
...
Args
>
auto
bindVariadic
(
ReturnType
(
ClassType
::*
memberFn
)
(
Args
...),
ClassType
*
instance
)
->
decltype
(
impl
::
bindVariadicImpl
<
ReturnType
>
(
memberFn
,
instance
,
typename
ns_mpl
::
generateIndexes
<
sizeof
...(
Args
),
1
>::
type
()
)
)
->
decltype
(
impl
::
bindVariadicImpl
<
ReturnType
>
(
memberFn
,
instance
,
typename
ns_mpl
::
generateIndexes
<
sizeof
...(
Args
),
1
>::
type
()
)
)
{
return
impl
::
bindVariadicImpl
<
ReturnType
>
(
memberFn
,
instance
,
// determine the number of provided arguments during compile time
// with generating an appropriate integer tuple with generateIndexes
// and provide a default constructed instance of that type to
// instantiate the correct implementation of the actual bind helper
// function that binds all arguments correctly
typename
ns_mpl
::
generateIndexes
<
sizeof
...(
Args
),
// for each argument in the list
1
// starting with placeholder index 1
>::
type
()
// determine the number of provided arguments during compile time
// with generating an appropriate integer tuple with generateIndexes
// and provide a default constructed instance of that type to
// instantiate the correct implementation of the actual bind helper
// function that binds all arguments correctly
typename
ns_mpl
::
generateIndexes
<
sizeof
...(
Args
),
// for each argument in the list
1
// starting with placeholder index 1
>::
type
()
);
}
...
...
@@ -192,27 +191,27 @@ auto bindVariadic( ReturnType (ClassType::* memberFn) (Args...), ClassType* inst
* @return a function object for the bound function
*/
template
<
typename
ReturnType
,
class
ClassType
,
typename
...
Args
typename
ReturnType
,
class
ClassType
,
typename
...
Args
>
auto
bindVariadic
(
ReturnType
(
ClassType
::*
memberFn
)
(
Args
...)
const
,
const
ClassType
*
instance
)
->
decltype
(
impl
::
bindVariadicImpl
<
ReturnType
>
(
memberFn
,
instance
,
typename
ns_mpl
::
generateIndexes
<
sizeof
...(
Args
),
1
>::
type
()
)
)
->
decltype
(
impl
::
bindVariadicImpl
<
ReturnType
>
(
memberFn
,
instance
,
typename
ns_mpl
::
generateIndexes
<
sizeof
...(
Args
),
1
>::
type
()
)
)
{
return
impl
::
bindVariadicImpl
<
ReturnType
>
(
memberFn
,
instance
,
// determine the number of provided arguments during compile time
// with generating an appropriate integer tuple with generateIndexes
// and provide a default constructed instance of that type to
// instantiate the correct implementation of the actual bind helper
// function that binds all arguments correctly
typename
ns_mpl
::
generateIndexes
<
sizeof
...(
Args
),
// for each argument in the list
1
// starting with placeholder index 1
>::
type
()
// determine the number of provided arguments during compile time
// with generating an appropriate integer tuple with generateIndexes
// and provide a default constructed instance of that type to
// instantiate the correct implementation of the actual bind helper
// function that binds all arguments correctly
typename
ns_mpl
::
generateIndexes
<
sizeof
...(
Args
),
// for each argument in the list
1
// starting with placeholder index 1
>::
type
()
);
}
...
...
src/qop/Queue.hpp
View file @
cfda7a78
...
...
@@ -177,8 +177,8 @@ namespace pfabric {
/**
* Creates a new instance of the operator.
*/
Queue
()
:
mNotifier
(
new
DequeueNotifier
(
boo
st
::
bind
(
&
Queue
::
dequeueTuple
,
this
,
_1
),
boo
st
::
bind
(
&
Queue
::
stopProcessing
,
this
)))
{
Queue
()
:
mNotifier
(
new
DequeueNotifier
(
st
d
::
bind
(
&
Queue
::
dequeueTuple
,
this
,
std
::
placeholders
::
_1
),
st
d
::
bind
(
&
Queue
::
stopProcessing
,
this
)))
{
}
/**
...
...
test/SignalTest.cpp
View file @
cfda7a78
...
...
@@ -27,7 +27,6 @@
#include
"libcpp/mpl/algorithms/StaticForEach.hpp"
#include
<boost/bind.hpp>
#include
<boost/mpl/vector.hpp>
...
...
@@ -145,7 +144,7 @@ struct SignalTest {
{
// test global function
// create the signal and connect a test slot
Signal
signal
;
auto
connection
=
SignalInterface
::
connect
(
signal
,
boo
st
::
bind
(
&
globalFunction
,
::
_1
,
::
_2
)
);
auto
connection
=
SignalInterface
::
connect
(
signal
,
st
d
::
bind
(
&
globalFunction
,
std
::
placeholders
::
_1
,
std
::
placeholders
::
_2
)
);
// invoke the signal
testResults
.
reset
();
...
...
Write
Preview
Supports
Markdown
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