diff --git a/src/lib/diff/record.hpp b/src/lib/diff/record.hpp index 3f4d6f306..5a4ab6a3b 100644 --- a/src/lib/diff/record.hpp +++ b/src/lib/diff/record.hpp @@ -428,6 +428,12 @@ namespace diff{ // standard copy operations acceptable + explicit + operator bool() const + { + return bool(record_); + } + /** target is accessed by cast * @throws error::Logic on bottom reference */ diff --git a/tests/library/diff/generic-record-representation-test.cpp b/tests/library/diff/generic-record-representation-test.cpp index 3ae9245a5..d6603335c 100644 --- a/tests/library/diff/generic-record-representation-test.cpp +++ b/tests/library/diff/generic-record-representation-test.cpp @@ -306,7 +306,7 @@ namespace test{ RecordRef empty; CHECK (bool(empty) == false); CHECK (nullptr == empty.get()); - VERIFY_ERROR (BOTTOM_VALUE, RecS& (empty)); + VERIFY_ERROR (BOTTOM_VALUE, empty.operator RecS&() ); RecordRef ref(oo); CHECK (ref);