Classes | Functions
fhicl::detail::yes_defaults Namespace Reference

Classes

struct  maybe_quotes
 
struct  maybe_quotes< std::string >
 

Functions

std::ostream & operator<< (std::ostream &os, maybe_quotes< bool > &&mq)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, maybe_quotes< T > &&mq)
 

Function Documentation

std::ostream& fhicl::detail::yes_defaults::operator<< ( std::ostream &  os,
maybe_quotes< bool > &&  mq 
)
inline

Definition at line 30 of file ostream_helpers.h.

31  {
32  return os << std::boolalpha << mq.value;
33  }
template<typename T >
std::ostream& fhicl::detail::yes_defaults::operator<< ( std::ostream &  os,
maybe_quotes< T > &&  mq 
)
inline

Definition at line 37 of file ostream_helpers.h.

38  {
39  if constexpr (std::is_floating_point_v<T>) {
40  return os << std::showpoint << mq.value;
41  } else {
42  return os << mq.value;
43  }
44  }