From 80ab6559c42fadfbac0f131ba62a5984ffc945a0 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 14 Nov 2023 23:47:38 -0500 Subject: [PATCH] cpp-common: rename bt2c::makeUnique() -> bt2s::make_unique() I now want everything mimicking the STL stuff to have the same names, but I don't want to mix coding styles in `bt2c`. Therefore introduce this new `bt2s` (the `s` stands for `std`) namespace to contain everything acting as the STL (or Boost, if need be). Signed-off-by: Philippe Proulx Change-Id: Ie24c11170cc650028f3ce50fcab2004f0195c12f Reviewed-on: https://review.lttng.org/c/babeltrace/+/11393 CI-Build: Simon Marchi Reviewed-by: Simon Marchi Tested-by: jenkins --- src/Makefile.am | 2 +- src/cpp-common/{bt2c => bt2s}/make-unique.hpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) rename src/cpp-common/{bt2c => bt2s}/make-unique.hpp (63%) diff --git a/src/Makefile.am b/src/Makefile.am index b5d24fe1..9f4796e4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,13 +47,13 @@ noinst_HEADERS = \ cpp-common/bt2c/glib-up.hpp \ cpp-common/bt2c/lib-str.hpp \ cpp-common/bt2c/libc-up.hpp \ - cpp-common/bt2c/make-unique.hpp \ cpp-common/bt2c/read-fixed-len-int.hpp \ cpp-common/bt2c/safe-ops.hpp \ cpp-common/bt2c/std-int.hpp \ cpp-common/bt2c/uuid-view.hpp \ cpp-common/bt2c/uuid.hpp \ cpp-common/bt2c/vector.hpp \ + cpp-common/bt2s/make-unique.hpp \ cpp-common/nlohmann/json.hpp \ cpp-common/optional.hpp \ cpp-common/string_view.hpp diff --git a/src/cpp-common/bt2c/make-unique.hpp b/src/cpp-common/bt2s/make-unique.hpp similarity index 63% rename from src/cpp-common/bt2c/make-unique.hpp rename to src/cpp-common/bt2s/make-unique.hpp index 95f55340..6c4d1bf7 100644 --- a/src/cpp-common/bt2c/make-unique.hpp +++ b/src/cpp-common/bt2s/make-unique.hpp @@ -4,26 +4,26 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_BT2C_MAKE_UNIQUE_HPP -#define BABELTRACE_CPP_COMMON_BT2C_MAKE_UNIQUE_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2S_MAKE_UNIQUE_HPP +#define BABELTRACE_CPP_COMMON_BT2S_MAKE_UNIQUE_HPP #include #include #include -namespace bt2c { +namespace bt2s { /* * Our implementation of std::make_unique<>() for C++11. */ template -std::unique_ptr makeUnique(ArgTs&&...args) +std::unique_ptr make_unique(ArgTs&&...args) { static_assert(!std::is_array::value, "`T` is not an array (unsupported)."); return std::unique_ptr(new T {std::forward(args)...}); } -} /* namespace bt2c */ +} /* namespace bt2s */ -#endif /* BABELTRACE_CPP_COMMON_BT2C_MAKE_UNIQUE_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2S_MAKE_UNIQUE_HPP */ -- 2.34.1