fix CI and be more strict also on the operator() call

This commit is contained in:
Sébastien Loriot 2023-02-27 09:55:49 +01:00
parent 17b137bf0c
commit da39109d88
2 changed files with 10 additions and 6 deletions

View File

@ -440,7 +440,7 @@ inline all_default()
}
#endif
template <class Tag, bool ref_only = false>
template <class Tag, bool ref_only = false, bool ref_is_const = false>
struct Boost_parameter_compatibility_wrapper
{
template <typename K>
@ -461,7 +461,7 @@ struct Boost_parameter_compatibility_wrapper
};
template <class Tag>
struct Boost_parameter_compatibility_wrapper<Tag, true>
struct Boost_parameter_compatibility_wrapper<Tag, true, true>
{
template <typename K>
Named_function_parameters<std::reference_wrapper<const K>, Tag>
@ -478,7 +478,11 @@ struct Boost_parameter_compatibility_wrapper<Tag, true>
typedef Named_function_parameters<std::reference_wrapper<const K>, Tag> Params;
return Params(std::cref(p));
}
};
template <class Tag>
struct Boost_parameter_compatibility_wrapper<Tag, true, false>
{
template <typename K>
Named_function_parameters<std::reference_wrapper<K>, Tag>
operator()(K& p) const
@ -509,9 +513,9 @@ struct Boost_parameter_compatibility_wrapper<Tag, true>
#define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \
const Boost_parameter_compatibility_wrapper<internal_np::X> Z;
#define CGAL_add_named_parameter_with_compatibility_cref_only(X, Y, Z) \
const Boost_parameter_compatibility_wrapper<internal_np::X, true> Z;
const Boost_parameter_compatibility_wrapper<internal_np::X, true, true> Z;
#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \
const Boost_parameter_compatibility_wrapper<internal_np::X, true> Z;
const Boost_parameter_compatibility_wrapper<internal_np::X, true, false> Z;
#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) \
const Boost_parameter_compatibility_wrapper<internal_np::X> Z;
#include <CGAL/STL_Extension/internal/parameters_interface.h>

View File

@ -220,9 +220,9 @@ git_dir=`pwd`
tmp_dir=`mktemp -d`
cd $tmp_dir
echo $tmp_dir
echo "#include <CGAL/Named_function_parameters.h>\nstruct A{};\nint main(){" > main.cpp
echo "#include <CGAL/Named_function_parameters.h>\nstruct A{};\nint main(){\nA a;\n" > main.cpp
for i in `echo $nps`; do
echo " CGAL::parameters::${i}(A()).${i}(A());" >> main.cpp
echo " CGAL::parameters::${i}(a).${i}(a);" >> main.cpp
done
echo "}" >> main.cpp
if ! g++ -DCGAL_NO_STATIC_ASSERTION_TESTS -I$git_dir/STL_Extension/include -I$git_dir/Stream_support/include -I$git_dir/Installation/include main.cpp; then