@@ -173,7 +173,7 @@ step_type<T> step(T t) {
173173 @tparam Value input value type, must be floating point.
174174 @tparam Transform builtin or user-defined transform type.
175175 @tparam MetaData type to store meta data.
176- @tparam Options see boost::histogram::axis::option (all values allowed) .
176+ @tparam Options see boost::histogram::axis::option.
177177 */
178178template <class Value , class Transform , class MetaData , class Options >
179179class regular : public iterator_mixin <regular<Value, Transform, MetaData, Options>>,
@@ -213,14 +213,16 @@ class regular : public iterator_mixin<regular<Value, Transform, MetaData, Option
213213 * @param start low edge of first bin.
214214 * @param stop high edge of last bin.
215215 * @param meta description of the axis (optional).
216+ * @param options see boost::histogram::axis::option (optional).
216217 */
217218 regular (transform_type trans, unsigned n, value_type start, value_type stop,
218- metadata_type meta = {})
219+ metadata_type meta = {}, options_type options = {} )
219220 : transform_type(std::move(trans))
220221 , metadata_base(std::move(meta))
221222 , size_(static_cast <index_type>(n))
222223 , min_(this ->forward (detail::get_scale(start)))
223224 , delta_(this ->forward (detail::get_scale(stop)) - min_) {
225+ (void )options;
224226 if (size () == 0 ) BOOST_THROW_EXCEPTION (std::invalid_argument (" bins > 0 required" ));
225227 if (!std::isfinite (min_) || !std::isfinite (delta_))
226228 BOOST_THROW_EXCEPTION (
@@ -235,46 +237,51 @@ class regular : public iterator_mixin<regular<Value, Transform, MetaData, Option
235237 * @param start low edge of first bin.
236238 * @param stop high edge of last bin.
237239 * @param meta description of the axis (optional).
240+ * @param options see boost::histogram::axis::option (optional).
238241 */
239- regular (unsigned n, value_type start, value_type stop, metadata_type meta = {})
240- : regular({}, n, start, stop, std::move(meta)) {}
242+ regular (unsigned n, value_type start, value_type stop, metadata_type meta = {},
243+ options_type options = {})
244+ : regular({}, n, start, stop, std::move(meta), options) {}
241245
242246 /* * Construct bins with the given step size over real transformed range
243247 * [start, stop).
244248 *
245- * @param trans transform instance to use.
246- * @param step width of a single bin.
247- * @param start low edge of first bin.
248- * @param stop upper limit of high edge of last bin (see below).
249- * @param meta description of the axis (optional).
249+ * @param trans transform instance to use.
250+ * @param step width of a single bin.
251+ * @param start low edge of first bin.
252+ * @param stop upper limit of high edge of last bin (see below).
253+ * @param meta description of the axis (optional).
254+ * @param options see boost::histogram::axis::option (optional).
250255 *
251256 * The axis computes the number of bins as n = abs(stop - start) / step,
252257 * rounded down. This means that stop is an upper limit to the actual value
253258 * (start + n * step).
254259 */
255260 template <class T >
256261 regular (transform_type trans, step_type<T> step, value_type start, value_type stop,
257- metadata_type meta = {})
262+ metadata_type meta = {}, options_type options = {} )
258263 : regular(trans, static_cast <index_type>(std::abs(stop - start) / step.value),
259264 start,
260265 start + static_cast<index_type>(std::abs(stop - start) / step.value) *
261266 step.value,
262- std::move(meta)) {}
267+ std::move(meta), options ) {}
263268
264269 /* * Construct bins with the given step size over real range [start, stop).
265270 *
266- * @param step width of a single bin.
267- * @param start low edge of first bin.
268- * @param stop upper limit of high edge of last bin (see below).
269- * @param meta description of the axis (optional).
271+ * @param step width of a single bin.
272+ * @param start low edge of first bin.
273+ * @param stop upper limit of high edge of last bin (see below).
274+ * @param meta description of the axis (optional).
275+ * @param options see boost::histogram::axis::option (optional).
270276 *
271277 * The axis computes the number of bins as n = abs(stop - start) / step,
272278 * rounded down. This means that stop is an upper limit to the actual value
273279 * (start + n * step).
274280 */
275281 template <class T >
276- regular (step_type<T> step, value_type start, value_type stop, metadata_type meta = {})
277- : regular({}, step, start, stop, std::move(meta)) {}
282+ regular (step_type<T> step, value_type start, value_type stop, metadata_type meta = {},
283+ options_type options = {})
284+ : regular({}, step, start, stop, std::move(meta), options) {}
278285
279286 // / Constructor used by algorithm::reduce to shrink and rebin (not for users).
280287 regular (const regular& src, index_type begin, index_type end, unsigned merge)
@@ -397,20 +404,28 @@ class regular : public iterator_mixin<regular<Value, Transform, MetaData, Option
397404
398405template <class T >
399406regular (unsigned , T, T)
400- ->regular<detail::convert_integer<T, double>, transform::id, null_type>;
407+ -> regular<detail::convert_integer<T, double>, transform::id, null_type>;
401408
402409template <class T , class M >
403- regular (unsigned , T, T, M)
404- ->regular<detail::convert_integer<T, double>, transform::id,
405- detail::replace_cstring<std::decay_t<M>>>;
410+ regular (unsigned , T, T, M) -> regular<detail::convert_integer<T, double>, transform::id,
411+ detail::replace_cstring<std::decay_t<M>>>;
412+
413+ template <class T , class M , unsigned B>
414+ regular (unsigned , T, T, M, const option::bitset<B>&)
415+ -> regular<detail::convert_integer<T, double>, transform::id,
416+ detail::replace_cstring<std::decay_t<M>>, option::bitset<B>>;
406417
407418template <class Tr , class T , class = detail::requires_transform<Tr, T>>
408- regular (Tr, unsigned , T, T)-> regular<detail::convert_integer<T, double>, Tr, null_type>;
419+ regular (Tr, unsigned , T, T) -> regular<detail::convert_integer<T, double>, Tr, null_type>;
409420
410421template <class Tr , class T , class M >
411- regular (Tr, unsigned , T, T, M)
412- ->regular<detail::convert_integer<T, double>, Tr,
413- detail::replace_cstring<std::decay_t<M>>>;
422+ regular (Tr, unsigned , T, T, M) -> regular<detail::convert_integer<T, double>, Tr,
423+ detail::replace_cstring<std::decay_t<M>>>;
424+
425+ template <class Tr , class T , class M , unsigned B>
426+ regular (Tr, unsigned , T, T, M, const option::bitset<B>&)
427+ -> regular<detail::convert_integer<T, double>, Tr,
428+ detail::replace_cstring<std::decay_t<M>>, option::bitset<B>>;
414429
415430#endif
416431
0 commit comments