Samchon Framework for CPP  1.0.0
samchon::IndexPair< T > Class Template Reference

A pair of index and its value(T) More...

#include <IndexPair.hpp>

Public Member Functions

 IndexPair ()
 Default Constructor. More...
 
template<class U >
 IndexPair (const IndexPair< U > &obj)
 Copy Constructor. More...
 
template<class U >
 IndexPair (const IndexPair< U > &&obj)
 Move Constructor. More...
 
 IndexPair (size_t index, const T &val)
 Construct from members. More...
 
auto getIndex () const -> size_t
 Get index. More...
 
auto getValue () -> T &
 Get reference of value. More...
 
auto getValue () const -> const T &
 Get const reference of const value. More...
 

Detailed Description

template<class T>
class samchon::IndexPair< T >

A pair of index and its value(T)

Template Parameters
TType of value.

IndexPair is a std::pair<size_t, T> class.

IndexPair expresses index and value. It's useful for expressing finding literals, specified object, calculating mininum or maximum with its position.

[Inherited]

This class couples together a pair of values, which may be of different types (T1 and T2). The individual values can be accessed through its public members first and second.

Pairs are a particular case of tuple.

Referenced comments of std::pair

Author
Jeongho Nam http://samchon.org

Definition at line 29 of file IndexPair.hpp.

Constructor & Destructor Documentation

template<class T>
samchon::IndexPair< T >::IndexPair ( )
inline

Default Constructor.

Definition at line 44 of file IndexPair.hpp.

template<class T>
template<class U >
samchon::IndexPair< T >::IndexPair ( const IndexPair< U > &  obj)
inline

Copy Constructor.

Definition at line 52 of file IndexPair.hpp.

template<class T>
template<class U >
samchon::IndexPair< T >::IndexPair ( const IndexPair< U > &&  obj)
inline

Move Constructor.

Definition at line 60 of file IndexPair.hpp.

template<class T>
samchon::IndexPair< T >::IndexPair ( size_t  index,
const T &  val 
)
inline

Construct from members.

Definition at line 68 of file IndexPair.hpp.

Member Function Documentation

template<class T>
auto samchon::IndexPair< T >::getIndex ( ) const -> size_t
inline

Get index.

Returns
Index of the pair

Definition at line 81 of file IndexPair.hpp.

Referenced by samchon::WeakString::betweens(), samchon::WeakString::finds(), samchon::library::StringUtil::finds(), samchon::WeakString::rfinds(), and samchon::library::StringUtil::rfinds().

Here is the caller graph for this function:

template<class T>
auto samchon::IndexPair< T >::getValue ( ) -> T&
inline

Get reference of value.

Returns
Reference of value of the pair

Definition at line 91 of file IndexPair.hpp.

Referenced by samchon::WeakString::betweens(), samchon::WeakString::finds(), samchon::library::StringUtil::finds(), samchon::WeakString::rfinds(), and samchon::library::StringUtil::rfinds().

Here is the caller graph for this function:

template<class T>
auto samchon::IndexPair< T >::getValue ( ) const -> const T&
inline

Get const reference of const value.

Returns
Const reference of value of the pair

Definition at line 101 of file IndexPair.hpp.


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