4 S(
bool *freed) : freed(freed) {}
24 auto s = std::make_shared<S>(freed);
42 auto maybe_int =
id.try_user<
int>();
43 auto maybe_s =
id.try_user<std::shared_ptr<S>>();
44 auto maybe_int2 = id2.try_user<
int>();
47 die(
"integer cannot be retrieved from isl::id");
48 if (maybe_int.value() != 5)
49 die(
"wrong integer retrieved from isl::id");
51 die(
"structure unexpectedly retrieved from isl::id");
53 die(
"integer unexpectedly retrieved from isl::id");
59 die(
"data structure freed prematurely");
60 auto maybe_s =
id.try_user<std::shared_ptr<S>>();
62 die(
"structure cannot be retrieved from isl::id");
63 if (maybe_s.value()->freed != &freed)
64 die(
"invalid structure retrieved from isl::id");
67 die(
"data structure not freed");
static isl::id construct_id(isl::ctx ctx, bool *freed)
static void test_try_user(isl::ctx ctx)