Samchon Framework for CPP  1.0.0
samchon::library::IOperator< T > Class Template Referenceabstract

Interface for comparision operator. More...

#include <IOperator.hpp>

Public Member Functions

 IOperator ()
 Default Constructor. More...
 
virtual auto operator< (const IOperator &) const -> bool=0
 Less. More...
 
virtual auto operator== (const IOperator &) const -> bool=0
 Equal. More...
 

Detailed Description

template<typename T>
class samchon::library::IOperator< T >

Interface for comparision operator.

IOperator is a template class makes enalbe to realizing all compare operators by only overriding operator< and operator== methods.

  • [!=] -> [NOT ==]
  • [<=] -> [< OR ==]
  • [>] -> [NOT < AND NOT ==]
  • [>=] -> [NOT <]

Methods operator< and operator== are abstract. Overrides them.

Note
If you want to realize all comparison operators without inheritance and specifying clear type of parameter, you can use following macros instead.
  • OPERATOR_METHODS_INLINE(_Ty)
  • OPERATOR_METHODS_HEADER(_Ty)
  • OPERATOR_METHODS_BODY(_Class, _Ty)
See also
samchon::library
Author
Jeongho Nam http://samchon.org

Definition at line 122 of file IOperator.hpp.

Constructor & Destructor Documentation

template<typename T>
samchon::library::IOperator< T >::IOperator ( )
inline

Default Constructor.

Definition at line 128 of file IOperator.hpp.

References samchon::library::IOperator< T >::operator<(), and samchon::library::IOperator< T >::operator==().

Here is the call graph for this function:

Member Function Documentation

template<typename T>
virtual auto samchon::library::IOperator< T >::operator< ( const IOperator< T > &  ) const -> bool
pure virtual

Less.

Overrides method less.

Parameters
objThe object to compare.
Returns
The object is less than this.

Referenced by samchon::library::IOperator< T >::IOperator().

Here is the caller graph for this function:

template<typename T>
virtual auto samchon::library::IOperator< T >::operator== ( const IOperator< T > &  ) const -> bool
pure virtual

Equal.

Overrides methods equal.

Parameters
objThe object to compare.
Returns
The object is equal with this.

Referenced by samchon::library::IOperator< T >::IOperator().

Here is the caller graph for this function:


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