mirror of https://github.com/CGAL/cgal
static_assert is a c++17 feature
This commit is contained in:
parent
1eda841d32
commit
646e6852dc
|
|
@ -46,7 +46,7 @@ template<class NamedParameters>
|
|||
void test_no_copyable(const NamedParameters& np)
|
||||
{
|
||||
typedef typename inp::Get_param<typename NamedParameters::base,inp::visitor_t>::type NP_type;
|
||||
static_assert( boost::is_same<NP_type,std::reference_wrapper<const B> > ::value );
|
||||
CGAL_static_assertion( boost::is_same<NP_type,std::reference_wrapper<const B> > ::value );
|
||||
|
||||
const A<4>& a = params::choose_parameter(params::get_parameter_reference(np, inp::edge_index), A<4>(4));
|
||||
assert(a.v==4);
|
||||
|
|
@ -60,31 +60,31 @@ void test_references(const NamedParameters& np)
|
|||
|
||||
// std::reference_wrapper
|
||||
typedef typename inp::Lookup_named_param_def<inp::visitor_t, NamedParameters, Default_type>::reference Visitor_reference_type;
|
||||
static_assert(std::is_same<B&, Visitor_reference_type>::value);
|
||||
CGAL_static_assertion(std::is_same<B&, Visitor_reference_type>::value);
|
||||
Visitor_reference_type vis_ref = params::choose_parameter(params::get_parameter_reference(np, inp::visitor), default_value);
|
||||
CGAL_USE(vis_ref);
|
||||
|
||||
// std::reference_wrapper of const
|
||||
typedef typename inp::Lookup_named_param_def<inp::face_index_t, NamedParameters, Default_type>::reference FIM_reference_type;
|
||||
static_assert(std::is_same<const B&, FIM_reference_type>::value);
|
||||
CGAL_static_assertion(std::is_same<const B&, FIM_reference_type>::value);
|
||||
FIM_reference_type fim_ref = params::choose_parameter(params::get_parameter_reference(np, inp::face_index), default_value);
|
||||
CGAL_USE(fim_ref);
|
||||
|
||||
// non-copyable
|
||||
typedef typename inp::Lookup_named_param_def<inp::vertex_point_t, NamedParameters, Default_type>::reference VPM_reference_type;
|
||||
static_assert(std::is_same<const B&, VPM_reference_type>::value);
|
||||
CGAL_static_assertion(std::is_same<const B&, VPM_reference_type>::value);
|
||||
VPM_reference_type vpm_ref = params::choose_parameter(params::get_parameter_reference(np, inp::vertex_point), default_value);
|
||||
CGAL_USE(vpm_ref);
|
||||
|
||||
// passed by copy
|
||||
typedef typename inp::Lookup_named_param_def<inp::vertex_index_t, NamedParameters, Default_type>::reference VIM_reference_type;
|
||||
static_assert(std::is_same<A<0>, VIM_reference_type>::value);
|
||||
CGAL_static_assertion(std::is_same<A<0>, VIM_reference_type>::value);
|
||||
VIM_reference_type vim_ref = params::choose_parameter(params::get_parameter_reference(np, inp::vertex_index), default_value);
|
||||
CGAL_USE(vim_ref);
|
||||
|
||||
// default
|
||||
typedef typename inp::Lookup_named_param_def<inp::edge_index_t, NamedParameters, Default_type>::reference EIM_reference_type;
|
||||
static_assert(std::is_same<Default_type&, EIM_reference_type>::value);
|
||||
CGAL_static_assertion(std::is_same<Default_type&, EIM_reference_type>::value);
|
||||
EIM_reference_type eim_ref = params::choose_parameter(params::get_parameter_reference(np, inp::edge_index), default_value);
|
||||
assert(&eim_ref==&default_value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue