Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit96ccdf7

Browse files
committed
#210-remove string_views stuff.
Completed. Validated.
1 parent5aa3489 commit96ccdf7

File tree

2 files changed

+8
-29
lines changed

2 files changed

+8
-29
lines changed

‎cpp-strings-tests/cpp-strings-tests.cpp‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ namespace cppstringstests
2323
Assert::AreEqual(wabcd.c_str(),CppWString(wabcd).c_str());
2424
}
2525

26-
TEST_METHOD(_csv)
27-
{
28-
usingnamespacepcs;
29-
auto abcd ="abcD"csv;
30-
auto wabcd =L"abcD"csv;
31-
Assert::AreEqual(abcd.c_str(),CppString(abcd).c_str());
32-
Assert::AreEqual(wabcd.c_str(),CppWString(wabcd).c_str());
33-
}
34-
3526
TEST_METHOD(is_alpha)
3627
{
3728
for (int ch =0; ch <=255; ++ch)
@@ -3063,7 +3054,7 @@ namespace cppstringstests
30633054
Assert::AreEqual(pcs::CppWString(L"abcd##efg").c_str(), ws.join(pcs::CppWString(L"abcd"),pcs::CppWString(L"efg")).c_str());
30643055
Assert::AreEqual(pcs::CppWString(L"abcd##efg##123456789").c_str(), ws.join(pcs::CppWString(L"abcd"),pcs::CppWString(L"efg"),pcs::CppWString(L"123456789")).c_str());
30653056
Assert::AreEqual(pcs::CppWString(L"abcd##efg##123456789##0").c_str(), ws.join(L"abcd"cs,L"efg"cs,L"123456789"cs,L"0"cs).c_str());
3066-
Assert::AreEqual(pcs::CppWString(L"abcd# #efg# #123456789# #0").c_str(),L"# #"csv.join(L"abcd",L"efg"cs,L"123456789"cs,L"0"cs).c_str());
3057+
Assert::AreEqual(pcs::CppWString(L"abcd# #efg# #123456789# #0").c_str(),L"# #"cs.join(L"abcd",L"efg"cs,L"123456789"cs,L"0"cs).c_str());
30673058
Assert::AreEqual(pcs::CppWString(L"abcdE").c_str(),L"##"cs.join(L"abcdE").c_str());
30683059
Assert::AreEqual(pcs::CppWString(L"##").c_str(),L"##"cs.join().c_str());
30693060
Assert::AreEqual(pcs::CppWString(L"").c_str(),L"##"cs.join(L"").c_str());

‎cpp-strings/cppstrings.h‎

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include<ranges>
3333
#include<span>
3434
#include<stdexcept>
35-
#include<string_view>
35+
//#include <string_view>
3636
#include<type_traits>
3737
#include<vector>
3838

@@ -85,11 +85,11 @@ namespace pcs // i.e. "pythonic c++ strings"
8585

8686

8787
// litteral operators
88+
#pragma warning(push)
8889
#pragma warning(disable: 4455)
8990
inline CppStringoperator""cs(constchar* str, std::size_t len);//!< Forms a CppString literal.
90-
inline CppStringoperator""csv(constchar* str, std::size_t len);//!< Forms a CppString view literal.
9191
inline CppWStringoperator""cs(constwchar_t* str, std::size_t len);//!< Forms a CppWString literal.
92-
inline CppWStringoperator""csv(constwchar_t* str, std::size_t len);//!< Forms a CppWString view literal.
92+
#pragma warning(pop)
9393

9494
// chars classifications -- not to be directly called, see respective specializations at the very end of this module.
9595
template<classCharT>
@@ -163,7 +163,6 @@ namespace pcs // i.e. "pythonic c++ strings"
163163
public:
164164
//=== Wrappers ========================================
165165
using MyBaseClass = std::basic_string<CharT, TraitsT, AllocatorT>;
166-
using MyStringView = std::basic_string_view<CharT, TraitsT>;
167166

168167
using traits_type = MyBaseClass::traits_type;
169168
using value_type = MyBaseClass::value_type;
@@ -330,7 +329,7 @@ namespace pcs // i.e. "pythonic c++ strings"
330329
* character in key is associated in the translation table with
331330
* the i-th character in values.
332331
*/
333-
/**/
332+
/**/
334333
template<classStringViewLike>
335334
explicitTransTable(const StringViewLike& keys,const StringViewLike& values)
336335
{
@@ -2032,31 +2031,20 @@ namespace pcs // i.e. "pythonic c++ strings"
20322031

20332032

20342033
//===== litteral operators ============================
2034+
#pragma warning(push)
2035+
#pragma warning(disable: 4455)
20352036
/** \brief Forms a CppString literal.*/
20362037
inline CppStringoperator""cs(constchar* str, std::size_t len)
20372038
{
20382039
returnCppString(CppString::MyBaseClass(str, len));
20392040
}
20402041

2041-
/** \brief Forms a CppString view literal.*/
2042-
inline CppStringoperator""csv(constchar* str, std::size_t len)
2043-
{
2044-
//return CppString(CppString::MyStringView(str, len));
2045-
returnCppString(str, len);
2046-
}
2047-
20482042
/** \brief Forms a CppWString literal.*/
20492043
inline CppWStringoperator""cs(constwchar_t* str, std::size_t len)
20502044
{
20512045
returnCppWString(CppWString::MyBaseClass(str, len));
20522046
}
2053-
2054-
/** \brief Forms a CppWString view literal.*/
2055-
inline CppWStringoperator""csv(constwchar_t* str, std::size_t len)
2056-
{
2057-
//return CppWString(CppWString::MyStringView(str, len));
2058-
returnCppWString(str, len);
2059-
}
2047+
#pragma warning(pop)
20602048

20612049

20622050
//===== templated chars classes ===========================

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp