MCPcopy Create free account
hub / github.com/boostorg/histogram / custom_axis

Class custom_axis

test/histogram_test.cpp:655–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

653 // custom axis
654 {
655 struct custom_axis : public axis::integer<> {
656 using value_type = const char*; // type that is fed to the axis
657
658 using integer::integer; // inherit ctors of base
659
660 // the customization point
661 // - accept const char* and convert to int
662 // - then call index method of base class
663 int index(value_type s) const { return integer::index(std::atoi(s)); }
664 };
665
666 auto h = make(Tag(), custom_axis(0, 3));
667 h("-10");

Callers 1

run_testsFunction · 0.70

Calls

no outgoing calls

Tested by 1

run_testsFunction · 0.56