Skip to content

Commit 683ebba

Browse files
avoid generic capture in lambdas
1 parent 4c2ec76 commit 683ebba

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

include/geode/stochastic/models/energy_terms/energy_term_builder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ namespace geode
135135
const SpatialDomain< ObjectType::dim >& domain )
136136
{
137137
return std::visit(
138-
[&]( const auto& term_cfg )
138+
[&object_sets, &domain]( const auto& term_cfg )
139139
-> std::unique_ptr< EnergyTerm< ObjectType > > {
140140
return build_energy_term_impl< ObjectType >(
141141
term_cfg, object_sets, domain );

include/geode/stochastic/models/energy_terms/single_object_term.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ namespace geode
9595
const ObjectSets< ObjectType >& state ) const override
9696
{
9797
double sum = 0.0;
98-
this->for_each_object_in_sets(
99-
state, this->impacted_set_ids(), [&]( const ObjectId& obj_id ) {
98+
this->for_each_object_in_sets( state, this->impacted_set_ids(),
99+
[&state, &sum, this]( const ObjectId& obj_id ) {
100100
const auto& obj = state.get_object( obj_id );
101-
sum += feature_->evaluate( obj, this->domain() );
101+
sum += this->feature_->evaluate( obj, this->domain() );
102102
} );
103103
return sum;
104104
}

include/geode/stochastic/spatial/pairwise_interactions/pairwise_interactions_builder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace geode
6868
build_pairwise_interaction( const PairwiseInteractionConfig& cfg )
6969
{
7070
return std::visit(
71-
[&]( auto&& interaction_cfg )
71+
[]( auto&& interaction_cfg )
7272
-> std::unique_ptr< PairwiseInteraction< ObjectType > > {
7373
return build_pairwise_interaction_impl< ObjectType >(
7474
interaction_cfg );

include/geode/stochastic/spatial/single_object_features/single_object_feature_builder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace geode
8080
build_single_object_feature( const SingleObjectFeatureConfig& cfg )
8181
{
8282
return std::visit(
83-
[&]( auto&& interaction_cfg )
83+
[]( auto&& interaction_cfg )
8484
-> std::unique_ptr< SingleObjectFeature< ObjectType > > {
8585
return build_single_object_feature_impl< ObjectType >(
8686
interaction_cfg );

0 commit comments

Comments
 (0)