Ookii.CommandLine for C++  2.0.0
Public Types | Public Member Functions | List of all members
ookii::string_less Struct Reference

A version of the std::less predicate for strings that supports case insensitive comparison. More...

#include <ookii/string_helper.h>

Public Types

using is_transparent = int
 Indicates that this function accepts any type and uses perfect forwarding.
 

Public Member Functions

 string_less (bool case_sensitive=true, std::locale loc={})
 Initializes a new instance of the string_less class. More...
 
template<typename Range1 , typename Range2 >
bool operator() (Range1 &&left, Range2 &&right) const
 Compares two strings. More...
 

Detailed Description

A version of the std::less predicate for strings that supports case insensitive comparison.

Constructor & Destructor Documentation

◆ string_less()

ookii::string_less::string_less ( bool  case_sensitive = true,
std::locale  loc = {} 
)
inline

Initializes a new instance of the string_less class.

Parameters
case_sensitivetrue to perform case sensitive comparisons; false to perform case insensitive comparisons.
locThe locale to use for case insensitive comparisons. This is not used for case sensitive comparisons.

Member Function Documentation

◆ operator()()

template<typename Range1 , typename Range2 >
bool ookii::string_less::operator() ( Range1 &&  left,
Range2 &&  right 
) const
inline

Compares two strings.

Template Parameters
Range1The type of the first string.
Range2The type of the second string.
Parameters
leftThe first string.
rightThe second string.
Returns
true if left is less than right; otherwise, false.

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