mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-12 14:54:10 +00:00
fix polymorphic functor
This commit is contained in:
parent
ac5ac257e6
commit
53b99b25f8
9 changed files with 60 additions and 47 deletions
|
@ -19,8 +19,7 @@ namespace sprout {
|
|||
T new_;
|
||||
public:
|
||||
SPROUT_CONSTEXPR replace_value_if(Predicate pred, T const& new_value)
|
||||
: pred_(pred)
|
||||
, new_(new_value)
|
||||
: pred_(pred), new_(new_value)
|
||||
{}
|
||||
SPROUT_CONSTEXPR T operator()(T const& value) const {
|
||||
return pred_(value) ? new_ : value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue