Sébastien Loriot
1eda841d32
workaround user taking ref to temporary
...
If D is a temporary, it's lifetime extension is done
when we go out of the scope of choose_parameter
so the const D& returned is dangling
2021-09-03 11:03:22 +02:00
Sébastien Loriot
abddb30bd7
no ref to internal value of the parameter pack
2021-09-02 10:08:46 +02:00
Sébastien Loriot
4e7f1ced58
readd missing function if D is a temporary
2021-09-01 11:44:25 +02:00
Sébastien Loriot
b4cbfc7b5c
more tests and a bugfix
2021-09-01 11:16:40 +02:00
Sébastien Loriot
0e730466ef
forgot temporary default
2021-09-01 10:13:15 +02:00
Sébastien Loriot
aaa3947e40
add a way to extract references from named parameters
2021-09-01 10:02:48 +02:00
Sébastien Loriot
3c257dd01c
allow non-copyable object for named parameters
2021-08-31 15:54:25 +02:00
Mael Rouxel-Labbé
2556196dad
Merge remote-tracking branch 'cgal/master' into CGAL-Optimal_bounding_box-GF
2020-03-23 08:59:49 +01:00
Mael Rouxel-Labbé
3864f6da9d
Add an overload of choose_parameter to avoid needless constructions
2020-03-12 22:20:06 +01:00
Mael Rouxel-Labbé
26463ded7a
Update NPs using default constructed default values to new API
...
+ misc cleaning
2020-02-28 11:55:17 +01:00
Mael Rouxel-Labbé
338089b2a5
Add an overload of choose_parameter with a single parameter
...
The previous (and only) overload of choose_parameter required two parameters,
with the default parameter often being a default constructed object
of type the type of the object being passed in named parameter.
For example:
typedef typename CGAL::GetPointMap<PointRange, NamedParameters>::type Point_map;
Point_map pm = choose_parameter(get_parameter(np, internal_np::point_map),
Point_map());
However, this can be unpleasant, for example when passing functors that have
an underlying lambda such (function_property_map, ...) because lambdas
cannot be default constructed.
With the new API:
typedef typename CGAL::GetPointMap<PointRange, NamedParameters>::type Point_map;
Point_map pm = choose_parameter<Point_map>(get_parameter(np, internal_np::point_map));
all is well.
2020-02-28 11:48:41 +01:00
Sébastien Loriot
52164b1fba
First pass on removing license notice in header for LGPL files
2019-10-19 15:40:30 +02:00
Sébastien Loriot
7356421d80
introduce Commercial license SPDX tag
2019-10-19 12:15:19 +02:00
Sébastien Loriot
9bd9c68b83
update LGPL[23]+ and GPL[23]+ SPDX tags
...
ack -l --no-svg "SPDX-License-Identifier: GPL-3.0\+" | xargs sed -i "s/SPDX-License-Identifier: GPL-3.0+/SPDX-License-Identifier: GPL-3.0-or-later/"
ack -l --no-svg "SPDX-License-Identifier: LGPL-3.0\+" | xargs sed -i "s/SPDX-License-Identifier: LGPL-3.0+/SPDX-License-Identifier: LGPL-3.0-or-later/"
ack -l --no-svg "SPDX-License-Identifier: GPL-2.0\+" | xargs sed -i "s/SPDX-License-Identifier: GPL-2.0+/SPDX-License-Identifier: GPL-2.0-or-later/"
ack -l --no-svg "SPDX-License-Identifier: LGPL-2.0\+" | xargs sed -i "s/SPDX-License-Identifier: LGPL-2.0+/SPDX-License-Identifier: LGPL-2.0-or-later/"
2019-10-18 21:57:54 +02:00
Sébastien Loriot
67ce5dd976
add code to prevent silent bad usage of boost::get_param
2019-09-04 15:59:44 +02:00
Mael Rouxel-Labbé
ae44cf3ff9
Do not return a const& for Named Parameters' default values
...
Since 'd' is in general some default constructed value, things can get weird,
for example with default constructed std::function
2019-07-23 11:58:21 +02:00
Sébastien Loriot
560c77f567
rename named function parameter class
2019-07-15 06:25:02 +02:00