Skip to content

Commit

Permalink
Tune varid capture only for vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
tkittel committed May 16, 2024
1 parent a6e4d7a commit 3029f2a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ncrystal_core/include/NCrystal/internal/NCCfgManip.hh
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,13 @@ namespace NCRYSTAL_NAMESPACE {
inline void CfgManip::setValue( CfgData& data, const TValType& val )
{
constexpr auto varid = constexpr_varIdFromName(TVarDef::name);
//NB: no need to capture &varid (even gives warning on apple clang 11):
//NB: no need to capture &varid (even gives warning on clang/gcc), but
//VSCode wants it:
#ifdef _MSC_VER
auto doCreate = [&val,&varid](){ return TVarDef::set_val( varid, val ); };
#else
auto doCreate = [&val](){ return TVarDef::set_val( varid, val ); };
#endif
detail_setVar( data, varid, doCreate );
}

Expand Down

0 comments on commit 3029f2a

Please sign in to comment.