Merge pull request #94 from wirenboard/fix/pass-by-ref

Pass visitor to validationCallback by ref
This commit is contained in:
Tristan Penman 2020-07-16 09:17:55 +10:00 committed by GitHub
commit f7f3acf20c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,7 +72,7 @@ public:
// Wrap the validationCallback() function below so that it will be
// passed a reference to a constraint (_1), and a reference to the
// visitor (*this).
Subschema::ApplyFunction fn(std::bind(validationCallback, std::placeholders::_1, *this));
Subschema::ApplyFunction fn(std::bind(validationCallback, std::placeholders::_1, std::ref(*this)));
// Perform validation against each constraint defined in the schema
if (m_results == nullptr) {