Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philip Trettner
tg-samples
Commits
712587b8
Commit
712587b8
authored
Feb 27, 2020
by
Philip Trettner
Browse files
added aabb_of test to impl-report
parent
1ac6397e
Pipeline
#13638
failed with stage
in 6 minutes and 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
typed-geometry
@
ac9db8c4
Subproject commit
53477031cc60ddad2dc130f2a45b0c748e8db249
Subproject commit
ac9db8c462fa3f41e84519b97ecfb8bfc9730820
tests/impl-report.cc
View file @
712587b8
...
@@ -54,6 +54,9 @@ using try_contains_pos3 = decltype(contains(std::declval<T const&>(), tg::pos3()
...
@@ -54,6 +54,9 @@ using try_contains_pos3 = decltype(contains(std::declval<T const&>(), tg::pos3()
template
<
class
T
>
template
<
class
T
>
using
try_uniform
=
decltype
(
uniform
(
detail
::
rng
,
std
::
declval
<
T
const
&>
()));
using
try_uniform
=
decltype
(
uniform
(
detail
::
rng
,
std
::
declval
<
T
const
&>
()));
template
<
class
T
>
using
try_aabb_of
=
decltype
(
aabb_of
(
std
::
declval
<
T
const
&>
()));
template
<
class
ObjT
>
template
<
class
ObjT
>
void
test_single_object_type
(
std
::
string
name
)
void
test_single_object_type
(
std
::
string
name
)
{
{
...
@@ -105,10 +108,15 @@ void test_single_object_type(std::string name)
...
@@ -105,10 +108,15 @@ void test_single_object_type(std::string name)
else
else
static_assert
(
tg
::
always_false
<
D
>
,
"not implemented"
);
static_assert
(
tg
::
always_false
<
D
>
,
"not implemented"
);
// o
nly
finite objects
can be sampled
// o
perations for
finite objects
if
constexpr
(
tg
::
object_traits
<
ObjT
>::
is_finite
)
if
constexpr
(
tg
::
object_traits
<
ObjT
>::
is_finite
)
{
if
constexpr
(
!
can_apply
<
try_uniform
,
ObjT
>
)
if
constexpr
(
!
can_apply
<
try_uniform
,
ObjT
>
)
std
::
cerr
<<
"no uniform(tg::rng, tg::"
<<
name
<<
")"
<<
std
::
endl
;
std
::
cerr
<<
"no uniform(tg::rng, tg::"
<<
name
<<
")"
<<
std
::
endl
;
if
constexpr
(
!
can_apply
<
try_aabb_of
,
ObjT
>
)
std
::
cerr
<<
"no aabb_of(tg::"
<<
name
<<
")"
<<
std
::
endl
;
}
}
}
template
<
template
<
int
,
class
>
class
ObjT
>
template
<
template
<
int
,
class
>
class
ObjT
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment