Restricting usage of owner<T> to pointer types (#507)

* Restricting usage of owner<T> to pointer types

* Removing an additional type that was created for testing

* Added comment about the new constraint on owner

* Adding dereference operator to not_null

* Removing dereference operator changes for not-null

* Removing dereference operator changes for not-null

* Review comments
This commit is contained in:
saurabh singh authored and Neil MacIntosh committed 2017-05-30 20:08:12 -07:00
1 parent 23581d4d63
commit 30595c1f1d
2 files changed
+23 -1

No files matched your search

+12
View File
@@ -20,6 +20,8 @@
#include <functional>
#include <memory>
using namespace gsl;
SUITE(owner_tests)
@@ -34,6 +36,16 @@ SUITE(owner_tests)
CHECK(*p == 121);
delete p;
}
TEST(check_pointer_constraint)
{
#ifdef CONFIRM_COMPILATION_ERRORS
{
owner<int> integerTest = 10;
owner<std::shared_ptr<int>> sharedPtrTest(new int(10));
}
#endif
}
}
int main(int, const char* []) { return UnitTest::RunAllTests(); }