scnlib  0.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Convenience scannable types

This category has types and factory functions, that can be passed as arguments to scn::scan (or alike), providing various functionality. More...

Classes

struct  scn::temporary< T >
 Allows reading an rvalue. More...
 

Functions

template<typename T >
temporary< T > scn::temp (T &&val)
 Factory function for temporary. More...
 
template<typename T >
discard_type< T > & scn::discard ()
 Scans an instance of T, but doesn't store it anywhere. More...
 

Detailed Description

This category has types and factory functions, that can be passed as arguments to scn::scan (or alike), providing various functionality.

Function Documentation

template<typename T >
discard_type<T>& scn::discard ( )

Scans an instance of T, but doesn't store it anywhere.

Uses scn::temp internally, so the user doesn't have to bother.

int i{};
// 123 is discarded, 456 is read into `i`
auto ret = scn::scan("123 456", "{} {}",
discard<T>(), i);
// ret == true
// ret.value() == 2
// i == 456

Definition at line 683 of file scan.h.

template<typename T >
temporary<T> scn::temp ( T &&  val)

Factory function for temporary.

Definition at line 61 of file args.h.