Loading [MathJax]/extensions/tex2jax.js
raberu v1.1.0
Fancy Named Parameter Library
 
All Classes Namespaces Functions Typedefs Friends Modules Pages Concepts
Loading...
Searching...
No Matches

◆ show()

std::ostream & rbr::as_keyword< typed_keyword< ID, Type > >::show ( std::ostream &  os,
V const &  v 
) const
inlineinherited

Stream insertion function.

Display a textual description of current keyword and bound value over an output stream.

If Keyword defines a display member variable, it will be used to perform this display. Otherwise, its value will be displayed along with either a user-defined identifier or its stringified typename.

Parameters
osOutput stream
vValue bound to current keyword
Returns
The up-to-date output stream

Example:

#include <raberu/raberu.hpp>
// Defines a keyword type that only accept floating point value
struct price_keyword : rbr::as_keyword<price_keyword>
{
std::ostream& display(std::ostream& os, auto const& v)
{
return os << "Price: " << v << '$';
}
};
inline constexpr price_keyword price = {};
constexpr any_keyword< ID > keyword(ID id) noexcept
Create a regular keyword for reuse.
Definition keywords.hpp:340
constexpr typed_keyword< ID, Type > keyword(ID id) noexcept
Create a typed Keyword for reuse.
Definition keywords.hpp:366
Base class for keyword definition.
Definition keywords.hpp:62