15
15
#include < boost/version.hpp>
16
16
#if BOOST_VERSION < 106100
17
17
#include < boost/utility/string_ref.hpp>
18
- namespace boost { using string_view = string_ref; }
18
+ namespace boost {
19
+ using string_view = string_ref;
20
+ }
19
21
#else
20
22
#include < boost/utility/string_view.hpp>
21
23
#endif
@@ -38,10 +40,7 @@ namespace boost {
38
40
namespace histogram {
39
41
namespace axis {
40
42
41
- enum {
42
- with_uoflow = true ,
43
- without_uoflow = false
44
- };
43
+ enum { with_uoflow = true , without_uoflow = false };
45
44
46
45
template <typename Value> struct bin {
47
46
int idx;
@@ -308,7 +307,8 @@ class regular : public axis_base<with_uoflow>,
308
307
* bins for this axis. Binning is a O(1) operation.
309
308
*/
310
309
template <typename RealType = double >
311
- class circular : public axis_base <without_uoflow>, boost::operators<regular<RealType>> {
310
+ class circular : public axis_base <without_uoflow>,
311
+ boost::operators<regular<RealType>> {
312
312
public:
313
313
using value_type = RealType;
314
314
using const_iterator = axis_iterator<circular>;
@@ -323,7 +323,8 @@ class circular : public axis_base<without_uoflow>, boost::operators<regular<Real
323
323
explicit circular (unsigned n, value_type phase = 0.0 ,
324
324
value_type perimeter = math::double_constants::two_pi,
325
325
string_view label = string_view())
326
- : axis_base<without_uoflow>(n, label), phase_(phase), perimeter_(perimeter) {}
326
+ : axis_base<without_uoflow>(n, label), phase_(phase),
327
+ perimeter_(perimeter) {}
327
328
328
329
circular () = default ;
329
330
circular (const circular &) = default ;
@@ -369,7 +370,8 @@ class circular : public axis_base<without_uoflow>, boost::operators<regular<Real
369
370
* and the problem domain allows it, prefer a regular.
370
371
*/
371
372
template <typename RealType = double >
372
- class variable : public axis_base <with_uoflow>, boost::operators<variable<RealType>> {
373
+ class variable : public axis_base <with_uoflow>,
374
+ boost::operators<variable<RealType>> {
373
375
public:
374
376
using value_type = RealType;
375
377
using const_iterator = axis_iterator<variable>;
@@ -392,8 +394,8 @@ class variable : public axis_base<with_uoflow>, boost::operators<variable<RealTy
392
394
}
393
395
394
396
template <typename Iterator>
395
- variable (Iterator begin, Iterator end,
396
- string_view label = string_view(), bool uoflow = true )
397
+ variable (Iterator begin, Iterator end, string_view label = string_view(),
398
+ bool uoflow = true )
397
399
: axis_base<with_uoflow>(std::distance(begin, end) - 1 , label, uoflow),
398
400
x_ (new value_type[std::distance(begin, end)]) {
399
401
std::copy (begin, end, x_.get ());
@@ -460,7 +462,8 @@ class variable : public axis_base<with_uoflow>, boost::operators<variable<RealTy
460
462
* faster than a regular.
461
463
*/
462
464
template <typename IntType = int >
463
- class integer : public axis_base <with_uoflow>, boost::operators<integer<IntType>> {
465
+ class integer : public axis_base <with_uoflow>,
466
+ boost::operators<integer<IntType>> {
464
467
public:
465
468
using value_type = IntType;
466
469
using const_iterator = axis_iterator<integer>;
@@ -470,8 +473,8 @@ class integer : public axis_base<with_uoflow>, boost::operators<integer<IntType>
470
473
* \param min smallest integer of the covered range.
471
474
* \param max largest integer of the covered range.
472
475
*/
473
- integer (value_type min, value_type max,
474
- string_view label = string_view(), bool uoflow = true )
476
+ integer (value_type min, value_type max, string_view label = string_view(),
477
+ bool uoflow = true )
475
478
: axis_base<with_uoflow>(max + 1 - min, label, uoflow), min_(min) {
476
479
if (min > max) {
477
480
throw std::logic_error (" min <= max required" );
@@ -525,8 +528,7 @@ class category : public axis_base<without_uoflow>, boost::operators<category> {
525
528
using const_iterator = axis_iterator<category>;
526
529
527
530
template <typename Iterator>
528
- category (Iterator begin, Iterator end,
529
- string_view label = string_view())
531
+ category (Iterator begin, Iterator end, string_view label = string_view())
530
532
: axis_base<without_uoflow>(std::distance(begin, end), label),
531
533
ptr_ (new std::string[bins()]) {
532
534
std::copy (begin, end, ptr_.get ());
@@ -555,7 +557,8 @@ class category : public axis_base<without_uoflow>, boost::operators<category> {
555
557
}
556
558
557
559
category (category &&other)
558
- : axis_base<without_uoflow>(std::move(other)), ptr_(std::move(other.ptr_)) {}
560
+ : axis_base<without_uoflow>(std::move(other)),
561
+ ptr_ (std::move(other.ptr_)) {}
559
562
560
563
category &operator =(category &&other) {
561
564
if (this != &other) {
@@ -598,8 +601,8 @@ class category : public axis_base<without_uoflow>, boost::operators<category> {
598
601
} // namespace axis
599
602
600
603
using builtin_axes =
601
- mpl::vector<axis::regular<>, axis::circular<>,
602
- axis::variable<>, axis:: integer<>, axis::category>;
604
+ mpl::vector<axis::regular<>, axis::circular<>, axis::variable<>,
605
+ axis::integer<>, axis::category>;
603
606
604
607
} // namespace histogram
605
608
} // namespace boost
0 commit comments