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

Class custom_axis

examples/guide_custom_axis.cpp:9–18  ·  view source on GitHub ↗

custom axis, which adapts builtin integer axis

Source from the content-addressed store, hash-verified

7
8// custom axis, which adapts builtin integer axis
9struct custom_axis : public bh::axis::integer<> {
10 using value_type = const char*; // type that is fed to the axis
11
12 using integer::integer; // inherit ctors of base
13
14 // the customization point
15 // - accept const char* and convert to int
16 // - then call index method of base class
17 int index(value_type s) const { return integer::index(std::atoi(s)); }
18};
19
20int main() {
21 auto h = bh::make_static_histogram(custom_axis(0, 3));

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected