Skip to content

Replace lambda by member function reference to silence Visual Studio #2463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/pointer-analysis/value_set_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Author: Daniel Kroening, [email protected]
#include <langapi/language_util.h>

void value_sets_to_xml(
std::function<const value_sett &(goto_programt::const_targett)> get_value_set,
const std::function<const value_sett &(goto_programt::const_targett)>
&get_value_set,
const goto_programt &goto_program,
xmlt &dest)
{
Expand Down
11 changes: 9 additions & 2 deletions src/pointer-analysis/value_set_analysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Author: Daniel Kroening, [email protected]
class xmlt;

void value_sets_to_xml(
std::function<const value_sett &(goto_programt::const_targett)> get_value_set,
const std::function<const value_sett &(goto_programt::const_targett)>
&get_value_set,
const goto_programt &goto_program,
xmlt &dest);

Expand All @@ -39,12 +40,18 @@ class value_set_analysis_templatet:
{
}

const value_sett &get_value_set(goto_programt::const_targett t)
{
return (*this)[t].value_set;
}

void convert(
const goto_programt &goto_program,
xmlt &dest) const
{
using std::placeholders::_1;
value_sets_to_xml(
[this](locationt l) { return (*this)[l].value_set; },
std::bind(&value_set_analysis_templatet::get_value_set, *this, _1),
goto_program,
dest);
}
Expand Down