The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
fmt::is_range< Gaudi::Property< T, V, H >, Char > Struct Template Reference

Definitions to allow use of Gaudi::Property<T> with fmtlib. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/PropertyFmt.h>

Inheritance diagram for fmt::is_range< Gaudi::Property< T, V, H >, Char >:
Collaboration diagram for fmt::is_range< Gaudi::Property< T, V, H >, Char >:

Detailed Description

template<typename T, typename V, typename H, typename Char>
struct fmt::is_range< Gaudi::Property< T, V, H >, Char >

Definitions to allow use of Gaudi::Property<T> with fmtlib.

When this header is included, one can pass a Gaudi::Property<T> instance as argument to fmt::format.

For example

#include <Gaudi/Property.h>
#include <fmt/format.h>
int main() {
Gaudi::Property<int> p{ "MyProp", 20 };
fmt::print( "property {} has value {}\n", p.name(), p );
}
int main()
const std::string name() const
property name
Implementation of property with value of concrete type.
Definition Property.h:35

will print

property MyProp has value 20

A special formatting option can be used to print the property name as well as the value, so

#include <Gaudi/Property.h>
#include <fmt/format.h>
#include <iostream>
int main() {
Gaudi::Property<int> p{ "MyProp", 20 };
std::cout << "cout" << p << '\n';
fmt::print( "fmt {:?}\n", p );
}

will print

cout 'MyProp':20
fmt 'MyProp':20

Definition at line 64 of file PropertyFmt.h.


The documentation for this struct was generated from the following file: