本文整理汇总了C++中SV::find_last_not_of方法的典型用法代码示例。如果您正苦于以下问题:C++ SV::find_last_not_of方法的具体用法?C++ SV::find_last_not_of怎么用?C++ SV::find_last_not_of使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SV
的用法示例。
在下文中一共展示了SV::find_last_not_of方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
{
typedef std::experimental::string_view S;
test(S(""), 'i', 0, S::npos);
test(S(""), 'i', 1, S::npos);
test(S("kitcj"), 'i', 0, 0);
test(S("qkamf"), 'i', 1, 1);
test(S("nhmko"), 'i', 2, 2);
test(S("tpsaf"), 'i', 4, 4);
test(S("lahfb"), 'i', 5, 4);
test(S("irkhs"), 'i', 6, 4);
test(S("gmfhdaipsr"), 'i', 0, 0);
test(S("kantesmpgj"), 'i', 1, 1);
test(S("odaftiegpm"), 'i', 5, 4);
test(S("oknlrstdpi"), 'i', 9, 8);
test(S("eolhfgpjqk"), 'i', 10, 9);
test(S("pcdrofikas"), 'i', 11, 9);
test(S("nbatdlmekrgcfqsophij"), 'i', 0, 0);
test(S("bnrpehidofmqtcksjgla"), 'i', 1, 1);
test(S("jdmciepkaqgotsrfnhlb"), 'i', 10, 10);
test(S("jtdaefblsokrmhpgcnqi"), 'i', 19, 18);
test(S("hkbgspofltajcnedqmri"), 'i', 20, 18);
test(S("oselktgbcapndfjihrmq"), 'i', 21, 19);
test(S(""), 'i', S::npos);
test(S("csope"), 'i', 4);
test(S("gfsmthlkon"), 'i', 9);
test(S("laenfsbridchgotmkqpj"), 'i', 19);
}
#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
constexpr SV sv2 { "abcde", 5 };
static_assert (sv1.find_last_not_of( 'i', 0 ) == SV::npos, "" );
static_assert (sv1.find_last_not_of( 'i', 1 ) == SV::npos, "" );
static_assert (sv2.find_last_not_of( 'a', 0 ) == SV::npos, "" );
static_assert (sv2.find_last_not_of( 'a', 1 ) == 1, "" );
static_assert (sv2.find_last_not_of( 'e', 5 ) == 3, "" );
}
#endif
}
示例2: main
int main()
{
{
typedef std::experimental::string_view S;
test0<S>();
test1<S>();
}
#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
constexpr SV sv2 { "abcde", 5 };
static_assert (sv1.find_last_not_of( "", 0) == SV::npos, "" );
static_assert (sv1.find_last_not_of( "irkhs", 5) == SV::npos, "" );
static_assert (sv2.find_last_not_of( "", 0) == 0, "" );
static_assert (sv2.find_last_not_of( "gfsrt", 5) == 4, "" );
static_assert (sv2.find_last_not_of( "lecar", 5) == 3, "" );
}
#endif
}