Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Florian Weik
waLBerla
Commits
9c333179
Commit
9c333179
authored
Feb 04, 2019
by
Michael Kuron
Browse files
Remove boost::bind from tutorial
parent
28dee213
Changes
1
Hide whitespace changes
Inline
Side-by-side
apps/tutorials/basics/02_Sweeps.dox
View file @
9c333179
...
...
@@ -120,7 +120,7 @@ void simpleSweep( IBlock * block )
There is still a problem with this function: It can only have a single argument, otherwise we can not register
it as a sweep at the time loop since we additionally need the BlockDataID of our field.
One possibility would be to have a global variable where the BlockDataID is stored (very bad design, do not do that!),
or we could use a construct from the
boost
library called
boo
st::bind().
or we could use a construct from the
standard
library called st
d
::bind().
The last can transform a function pointer of a two-argument function to a function pointer of a one-argument function
by keeping the second argument constant: It "binds" the second argument to a fixed value.
...
...
@@ -139,7 +139,7 @@ and register it at the time loop with the following:
\code
SweepTimeloop timeloop( blocks, uint_c(1) );
auto pointerToTwoArgFunction = & simpleSweep;
auto pointerToOneArgFunction =
boo
st::bind( pointerToTwoArgFunction, _1, fieldID );
auto pointerToOneArgFunction = st
d
::bind( pointerToTwoArgFunction, _1, fieldID );
timeloop.add() << Sweep( pointerToOneArgFunction, "BogusAlgorithm" );
\endcode
...
...
@@ -149,7 +149,7 @@ can be piped in. If you want to know more about the sweep registration read the
\section tut02_sweep_class Register a Class as Sweep
The variant described above using
boo
st::bind() may seem a little strange but there is also another solution.
The variant described above using st
d
::bind() may seem a little strange but there is also another solution.
Instead of writing a sweep function, we write a functor class overloading the call operator.
\code
...
...
@@ -182,7 +182,7 @@ private:
};
\endcode
With this, the registration code does not need
boo
st::bind any more:
With this, the registration code does not need st
d
::bind any more:
\code
timeloop.add() << Sweep( SimpleSweep(fieldID), "BogusAlgorithmButNowAsFunctor" );
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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