use std::string_view
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* A Combox Implementation
|
||||
* Nana C++ Library(http://www.nanapro.org)
|
||||
* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
|
||||
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -823,6 +823,14 @@ namespace nana
|
||||
}
|
||||
|
||||
/// Behavior of Iterator's value_type
|
||||
#ifdef _nana_std_has_string_view
|
||||
bool item_proxy::operator == (::std::string_view s) const
|
||||
{
|
||||
if (pos_ == nana::npos)
|
||||
return false;
|
||||
return (impl_->at(pos_).item_text == s);
|
||||
}
|
||||
#else
|
||||
bool item_proxy::operator == (const ::std::string& s) const
|
||||
{
|
||||
if (pos_ == nana::npos)
|
||||
@@ -836,6 +844,7 @@ namespace nana
|
||||
return false;
|
||||
return (impl_->at(pos_).item_text == s);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/// Behavior of Iterator
|
||||
|
||||
@@ -4825,6 +4825,17 @@ namespace nana
|
||||
}
|
||||
|
||||
//Behavior of Iterator's value_type
|
||||
#ifdef _nana_std_has_string_view
|
||||
bool item_proxy::operator==(std::string_view sv) const
|
||||
{
|
||||
return (text(0) == sv);
|
||||
}
|
||||
|
||||
bool item_proxy::operator==(std::wstring_view sv) const
|
||||
{
|
||||
return (text(0) == to_utf8(sv));
|
||||
}
|
||||
#else
|
||||
bool item_proxy::operator==(const char * s) const
|
||||
{
|
||||
return this->operator==(std::string(s));
|
||||
@@ -4844,6 +4855,7 @@ namespace nana
|
||||
{
|
||||
return (text(0) == to_utf8(s));
|
||||
}
|
||||
#endif
|
||||
|
||||
item_proxy & item_proxy::operator=(const item_proxy& rhs)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user