aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorMaxim Yurchuk <maxim-yurchuk@ydb.tech>2024-10-20 00:06:50 +0300
committerGitHub <noreply@github.com>2024-10-20 00:06:50 +0300
commite0b481c6710337ae655271bbb80afe6ac81a5614 (patch)
treedba67dc017935800d0c3f8dc967e9522c5302bd2 /library/cpp
parent07f2e60d02d95eab14a86a4b9469db1af7795001 (diff)
parentf04ad7e5462f5910ef95f2efd15c509e539ae62d (diff)
downloadydb-e0b481c6710337ae655271bbb80afe6ac81a5614.tar.gz
Merge pull request #10642 from ydb-platform/mergelibs-241019-1758
Library import 241019-1758
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/cache/thread_safe_cache.h1
-rw-r--r--library/cpp/linear_regression/linear_regression.h1
-rw-r--r--library/cpp/tld/tlds-alpha-by-domain.txt2
-rw-r--r--library/cpp/yt/memory/blob.cpp4
-rw-r--r--library/cpp/yt/memory/ya.make4
-rw-r--r--library/cpp/yt/string/string-inl.h32
-rw-r--r--library/cpp/yt/string/string.h28
7 files changed, 40 insertions, 32 deletions
diff --git a/library/cpp/cache/thread_safe_cache.h b/library/cpp/cache/thread_safe_cache.h
index e77d1a45fd..b4bd4deedf 100644
--- a/library/cpp/cache/thread_safe_cache.h
+++ b/library/cpp/cache/thread_safe_cache.h
@@ -3,6 +3,7 @@
#include "cache.h"
#include <util/generic/singleton.h>
+#include <util/generic/ylimits.h>
#include <util/system/rwlock.h>
namespace NPrivate {
diff --git a/library/cpp/linear_regression/linear_regression.h b/library/cpp/linear_regression/linear_regression.h
index e57de5ff6c..5f2a2a1ca9 100644
--- a/library/cpp/linear_regression/linear_regression.h
+++ b/library/cpp/linear_regression/linear_regression.h
@@ -7,6 +7,7 @@
#include <util/generic/vector.h>
#include <util/generic/hash.h>
+#include <util/generic/ylimits.h>
#include <util/generic/ymath.h>
class TFastLinearRegressionSolver {
diff --git a/library/cpp/tld/tlds-alpha-by-domain.txt b/library/cpp/tld/tlds-alpha-by-domain.txt
index f755065df7..055d440b6e 100644
--- a/library/cpp/tld/tlds-alpha-by-domain.txt
+++ b/library/cpp/tld/tlds-alpha-by-domain.txt
@@ -1,4 +1,4 @@
-# Version 2024101300, Last Updated Sun Oct 13 07:07:01 2024 UTC
+# Version 2024101600, Last Updated Wed Oct 16 07:07:02 2024 UTC
AAA
AARP
ABB
diff --git a/library/cpp/yt/memory/blob.cpp b/library/cpp/yt/memory/blob.cpp
index 260cfb698b..b4de038948 100644
--- a/library/cpp/yt/memory/blob.cpp
+++ b/library/cpp/yt/memory/blob.cpp
@@ -197,6 +197,8 @@ void TBlob::SetTagCookie(TRefCountedTypeCookie tagCookie)
{
#ifdef YT_ENABLE_REF_COUNTED_TRACKING
TagCookie_ = tagCookie;
+#else
+ Y_UNUSED(tagCookie);
#endif
}
@@ -204,6 +206,8 @@ void TBlob::SetTagCookie(const TBlob& other)
{
#ifdef YT_ENABLE_REF_COUNTED_TRACKING
TagCookie_ = other.TagCookie_;
+#else
+ Y_UNUSED(other);
#endif
}
diff --git a/library/cpp/yt/memory/ya.make b/library/cpp/yt/memory/ya.make
index c2d78b0d07..bd817454a9 100644
--- a/library/cpp/yt/memory/ya.make
+++ b/library/cpp/yt/memory/ya.make
@@ -2,6 +2,10 @@ LIBRARY()
INCLUDE(${ARCADIA_ROOT}/library/cpp/yt/ya_cpp.make.inc)
+IF (YT_DISABLE_REF_COUNTED_TRACKING)
+ CXXFLAGS(-DYT_DISABLE_REF_COUNTED_TRACKING)
+ENDIF()
+
SRCS(
allocation_tags_hooks.cpp
blob.cpp
diff --git a/library/cpp/yt/string/string-inl.h b/library/cpp/yt/string/string-inl.h
index baf789b4f1..e3bf094aa3 100644
--- a/library/cpp/yt/string/string-inl.h
+++ b/library/cpp/yt/string/string-inl.h
@@ -4,7 +4,7 @@
#include "string.h"
#endif
-#include "format.h"
+#include "string_builder.h"
namespace NYT {
@@ -19,7 +19,7 @@ namespace NYT {
* \param delimiter A delimiter to be inserted between items: ", " by default.
* \return The resulting combined string.
*/
-template <class TIterator, class TFormatter>
+template <std::forward_iterator TIterator, class TFormatter>
void JoinToString(
TStringBuilderBase* builder,
const TIterator& begin,
@@ -35,7 +35,7 @@ void JoinToString(
}
}
-template <class TIterator, class TFormatter>
+template <std::forward_iterator TIterator, class TFormatter>
TString JoinToString(
const TIterator& begin,
const TIterator& end,
@@ -48,7 +48,7 @@ TString JoinToString(
}
//! A handy shortcut with default formatter.
-template <class TIterator>
+template <std::forward_iterator TIterator>
TString JoinToString(
const TIterator& begin,
const TIterator& end,
@@ -63,9 +63,9 @@ TString JoinToString(
* \param formatter Formatter to apply to the items.
* \param delimiter A delimiter to be inserted between items; ", " by default.
*/
-template <class TCollection, class TFormatter>
+template <std::ranges::range TCollection, class TFormatter>
TString JoinToString(
- const TCollection& collection,
+ TCollection&& collection,
const TFormatter& formatter,
TStringBuf delimiter)
{
@@ -75,12 +75,12 @@ TString JoinToString(
}
//! A handy shortcut with the default formatter.
-template <class TCollection>
+template <std::ranges::range TCollection>
TString JoinToString(
- const TCollection& collection,
+ TCollection&& collection,
TStringBuf delimiter)
{
- return JoinToString(collection, TDefaultFormatter(), delimiter);
+ return JoinToString(std::forward<TCollection>(collection), TDefaultFormatter(), delimiter);
}
//! Concatenates a bunch of TStringBuf-like instances into TString.
@@ -98,7 +98,7 @@ TString ConcatToString(Ts... args)
}
//! Converts a range of items into strings.
-template <class TIter, class TFormatter>
+template <std::forward_iterator TIter, class TFormatter>
std::vector<TString> ConvertToStrings(
const TIter& begin,
const TIter& end,
@@ -118,7 +118,7 @@ std::vector<TString> ConvertToStrings(
}
//! A handy shortcut with the default formatter.
-template <class TIter>
+template <std::forward_iterator TIter>
std::vector<TString> ConvertToStrings(
const TIter& begin,
const TIter& end,
@@ -133,9 +133,9 @@ std::vector<TString> ConvertToStrings(
* \param formatter Formatter to apply to the items.
* \param maxSize Size limit for the resulting vector.
*/
-template <class TCollection, class TFormatter>
+template <std::ranges::range TCollection, class TFormatter>
std::vector<TString> ConvertToStrings(
- const TCollection& collection,
+ TCollection&& collection,
const TFormatter& formatter,
size_t maxSize)
{
@@ -145,12 +145,12 @@ std::vector<TString> ConvertToStrings(
}
//! A handy shortcut with default formatter.
-template <class TCollection>
+template <std::ranges::range TCollection>
std::vector<TString> ConvertToStrings(
- const TCollection& collection,
+ TCollection&& collection,
size_t maxSize)
{
- return ConvertToStrings(collection, TDefaultFormatter(), maxSize);
+ return ConvertToStrings(std::forward<TCollection>(collection), TDefaultFormatter(), maxSize);
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/library/cpp/yt/string/string.h b/library/cpp/yt/string/string.h
index b91d1b3805..9794cfd69f 100644
--- a/library/cpp/yt/string/string.h
+++ b/library/cpp/yt/string/string.h
@@ -9,8 +9,6 @@
#include <util/string/strip.h>
#include <vector>
-#include <set>
-#include <map>
namespace NYT {
@@ -65,7 +63,7 @@ static constexpr TStringBuf IntToHexUppercase = "0123456789ABCDEF";
* \param delimiter A delimiter to be inserted between items: ", " by default.
* \return The resulting combined string.
*/
-template <class TIterator, class TFormatter>
+template <std::forward_iterator TIterator, class TFormatter>
void JoinToString(
TStringBuilderBase* builder,
const TIterator& begin,
@@ -73,7 +71,7 @@ void JoinToString(
const TFormatter& formatter,
TStringBuf delimiter = DefaultJoinToStringDelimiter);
-template <class TIterator, class TFormatter>
+template <std::forward_iterator TIterator, class TFormatter>
TString JoinToString(
const TIterator& begin,
const TIterator& end,
@@ -81,7 +79,7 @@ TString JoinToString(
TStringBuf delimiter = DefaultJoinToStringDelimiter);
//! A handy shortcut with default formatter.
-template <class TIterator>
+template <std::forward_iterator TIterator>
TString JoinToString(
const TIterator& begin,
const TIterator& end,
@@ -93,16 +91,16 @@ TString JoinToString(
* \param formatter Formatter to apply to the items.
* \param delimiter A delimiter to be inserted between items; ", " by default.
*/
-template <class TCollection, class TFormatter>
+template <std::ranges::range TCollection, class TFormatter>
TString JoinToString(
- const TCollection& collection,
+ TCollection&& collection,
const TFormatter& formatter,
TStringBuf delimiter = DefaultJoinToStringDelimiter);
//! A handy shortcut with the default formatter.
-template <class TCollection>
+template <std::ranges::range TCollection>
TString JoinToString(
- const TCollection& collection,
+ TCollection&& collection,
TStringBuf delimiter = DefaultJoinToStringDelimiter);
//! Concatenates a bunch of TStringBuf-like instances into TString.
@@ -110,7 +108,7 @@ template <class... Ts>
TString ConcatToString(Ts... args);
//! Converts a range of items into strings.
-template <class TIter, class TFormatter>
+template <std::forward_iterator TIter, class TFormatter>
std::vector<TString> ConvertToStrings(
const TIter& begin,
const TIter& end,
@@ -118,7 +116,7 @@ std::vector<TString> ConvertToStrings(
size_t maxSize = std::numeric_limits<size_t>::max());
//! A handy shortcut with the default formatter.
-template <class TIter>
+template <std::forward_iterator TIter>
std::vector<TString> ConvertToStrings(
const TIter& begin,
const TIter& end,
@@ -130,16 +128,16 @@ std::vector<TString> ConvertToStrings(
* \param formatter Formatter to apply to the items.
* \param maxSize Size limit for the resulting vector.
*/
-template <class TCollection, class TFormatter>
+template <std::ranges::range TCollection, class TFormatter>
std::vector<TString> ConvertToStrings(
- const TCollection& collection,
+ TCollection&& collection,
const TFormatter& formatter,
size_t maxSize = std::numeric_limits<size_t>::max());
//! A handy shortcut with default formatter.
-template <class TCollection>
+template <std::ranges::range TCollection>
std::vector<TString> ConvertToStrings(
- const TCollection& collection,
+ TCollection&& collection,
size_t maxSize = std::numeric_limits<size_t>::max());
////////////////////////////////////////////////////////////////////////////////