Skip to content

Commit d4510c4

Browse files
author
dgolear
committed
Remove std::nullptr_t ctor for TString
commit_hash:6b02e6cb83bde366477f7d53b6cd6c00bffdb4d6
1 parent b3a63b7 commit d4510c4

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

util/generic/strbuf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ class TBasicStringBuf: public std::basic_string_view<TCharType>,
9898
* to generate compilation error instead.
9999
*/
100100
constexpr inline TBasicStringBuf(std::nullptr_t begin, size_t size) = delete;
101+
// TODO: Uncomment.
102+
// constexpr TBasicStringBuf(std::nullptr_t) = delete;
101103

102104
constexpr inline TBasicStringBuf(const TCharType* data Y_LIFETIME_BOUND, size_t size) noexcept
103105
: TStringView(data, size)

util/generic/string.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,7 @@ class TBasicString: public TStringBase<TBasicString<TCharType, TTraits>, TCharTy
463463
: TBasicString(pc, TBase::StrLen(pc))
464464
{
465465
}
466-
// TODO thegeorg@: uncomment and fix clients
467-
// TBasicString(std::nullptr_t) = delete;
466+
TBasicString(std::nullptr_t) = delete;
468467

469468
TBasicString(const TCharType* pc, size_t n)
470469
#ifdef TSTRING_IS_STD_STRING

util/generic/string_ut.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -525,18 +525,14 @@ class TStringTestImpl {
525525
}
526526

527527
void TestConstructors() {
528-
TStringType s0(nullptr);
528+
TStringType s0;
529529
UNIT_ASSERT(s0.size() == 0);
530-
UNIT_ASSERT_EQUAL(s0, TStringType());
531530

532531
TStringType s;
533532
TStringType s1(*Data._0());
534533
TStringType s2(Data._0());
535534
UNIT_ASSERT(s1 == s2);
536535

537-
TStringType fromZero(0);
538-
UNIT_ASSERT_VALUES_EQUAL(fromZero.size(), 0u);
539-
540536
TStringType fromChar(char_type('a'));
541537
UNIT_ASSERT_VALUES_EQUAL(fromChar.size(), 1u);
542538
UNIT_ASSERT_VALUES_EQUAL(fromChar[0], char_type('a'));

0 commit comments

Comments
 (0)