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 get_index () 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 30 of file IndexPair.hpp.

Constructor & Destructor Documentation

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

Default Constructor.

Definition at line 45 of file IndexPair.hpp.

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

Copy Constructor.

Definition at line 53 of file IndexPair.hpp.

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

Move Constructor.

Definition at line 61 of file IndexPair.hpp.

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

Construct from members.

Definition at line 69 of file IndexPair.hpp.

Member Function Documentation

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

Get index.

Returns
Index of the pair

Definition at line 82 of file IndexPair.hpp.

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

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 92 of file IndexPair.hpp.

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

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 102 of file IndexPair.hpp.


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