C++ YT Wrapper
C++ library for working with YT clusters
Loading...
Searching...
No Matches
NYT::TOneOrMany< T, TDerived > Struct Template Reference

Convenience class that keeps sequence of items. More...

#include <common.h>

Public Member Functions

 TOneOrMany ()=default
 Initialize with empty sequence.
template<class U>
 TOneOrMany (std::initializer_list< U > il)
template<class U, class... TArgs>
requires std::is_convertible_v<U, T>
 TOneOrMany (U &&arg, TArgs &&... args)
 Put arguments to sequence.
 TOneOrMany (TVector< T > args)
 Initialize from vector.
bool operator== (const TOneOrMany &rhs) const
 Order is defined the same way as in TVector.
template<class U, class... TArgs>
requires std::is_convertible_v<U, T>
TSelf & Add (U &&part, TArgs &&... args) &
 Add all arguments to sequence.
template<class U, class... TArgs>
requires std::is_convertible_v<U, T>
TSelf Add (U &&part, TArgs &&... args) &&

Public Attributes

TVector< T > Parts_
 Content of sequence.

Detailed Description

template<class T, class TDerived>
struct NYT::TOneOrMany< T, TDerived >

Convenience class that keeps sequence of items.

Designed to be used as function parameter.

Users of such function can then pass:

  • single item,
  • initializer list of items,
  • vector of items; as argument to this function.

Example:

void Foo(const TOneOrMany<int>& arg);
...
Foo(1); // ok
Foo({1, 2, 3}); // ok
TOneOrMany()=default
Initialize with empty sequence.

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