diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-01-05 12:47:08 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-01-05 12:55:28 -0800 |
| commit | 0b5e2e9e76e66b566cf4d3f68146fdbdff2bac05 (patch) | |
| tree | 5eca03ad9eeb2c91bcafa28fe3557e92b561524b | |
| parent | b280f57002044036c1c3c9a446c06e8e0a34fb00 (diff) | |
| download | vcpkg-0b5e2e9e76e66b566cf4d3f68146fdbdff2bac05.tar.gz vcpkg-0b5e2e9e76e66b566cf4d3f68146fdbdff2bac05.zip | |
Use nested namespace definition
| -rw-r--r-- | toolsrc/include/vcpkg_Checks.h | 4 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Files.h | 4 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Graphs.h | 4 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Maps.h | 4 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Sets.h | 4 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Strings.h | 8 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_System.h | 4 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Checks.cpp | 4 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Files.cpp | 4 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Strings.cpp | 8 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_System.cpp | 6 |
11 files changed, 27 insertions, 27 deletions
diff --git a/toolsrc/include/vcpkg_Checks.h b/toolsrc/include/vcpkg_Checks.h index 9d9b21ed6..a58b38ac0 100644 --- a/toolsrc/include/vcpkg_Checks.h +++ b/toolsrc/include/vcpkg_Checks.h @@ -2,7 +2,7 @@ #include "vcpkg_Strings.h" -namespace vcpkg {namespace Checks +namespace vcpkg::Checks { __declspec(noreturn) void unreachable(); @@ -46,4 +46,4 @@ namespace vcpkg {namespace Checks exit_with_message(Strings::format(errorMessageTemplate, errorMessageArgs...).c_str()); } } -}} +} diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 6c9d0d365..3f9570946 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -4,7 +4,7 @@ #include "filesystem_fs.h" #include <iterator> -namespace vcpkg {namespace Files +namespace vcpkg::Files { static const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)"; @@ -53,4 +53,4 @@ namespace vcpkg {namespace Files std::vector<fs::path> non_recursive_find_all_files_in_dir(const fs::path& dir); void print_paths(const std::vector<fs::path>& paths); -}} +} diff --git a/toolsrc/include/vcpkg_Graphs.h b/toolsrc/include/vcpkg_Graphs.h index 9444ac45b..933d9ac67 100644 --- a/toolsrc/include/vcpkg_Graphs.h +++ b/toolsrc/include/vcpkg_Graphs.h @@ -3,7 +3,7 @@ #include <unordered_map> #include <unordered_set> -namespace vcpkg { namespace Graphs +namespace vcpkg::Graphs { enum class ExplorationStatus { @@ -117,4 +117,4 @@ namespace vcpkg { namespace Graphs private: std::unordered_map<V, std::unordered_set<V>> vertices; }; -}} +} diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h index c67462a39..5e2f92f55 100644 --- a/toolsrc/include/vcpkg_Maps.h +++ b/toolsrc/include/vcpkg_Maps.h @@ -4,7 +4,7 @@ #include <unordered_set> #include <map> -namespace vcpkg { namespace Maps +namespace vcpkg::Maps { template <typename K, typename V> std::unordered_set<K> extract_key_set(const std::unordered_map<K, V>& input_map) @@ -38,4 +38,4 @@ namespace vcpkg { namespace Maps } return key_set; } -}} +} diff --git a/toolsrc/include/vcpkg_Sets.h b/toolsrc/include/vcpkg_Sets.h index 7b330f31c..6dec95b89 100644 --- a/toolsrc/include/vcpkg_Sets.h +++ b/toolsrc/include/vcpkg_Sets.h @@ -3,7 +3,7 @@ #include "vcpkg_Checks.h" #include <unordered_set> -namespace vcpkg { namespace Sets +namespace vcpkg::Sets { template <typename T, typename Container> void remove_all(std::unordered_set<T>* input_set, Container remove_these) @@ -14,4 +14,4 @@ namespace vcpkg { namespace Sets input_set->erase(r); } } -}} +} diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index a117a1a81..28853cb5d 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -2,7 +2,7 @@ #include <vector> -namespace vcpkg {namespace Strings {namespace details +namespace vcpkg::Strings::details { inline const char* to_printf_arg(const std::string& s) { @@ -42,9 +42,9 @@ namespace vcpkg {namespace Strings {namespace details } std::wstring wformat_internal(const wchar_t* fmtstr, ...); -}}} +} -namespace vcpkg {namespace Strings +namespace vcpkg::Strings { template <class...Args> std::string format(const char* fmtstr, const Args&...args) @@ -75,4 +75,4 @@ namespace vcpkg {namespace Strings std::string trimmed(const std::string& s); void trim_all_and_remove_whitespace_strings(std::vector<std::string>* strings); -}} +} diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 1101c9b27..c9195163c 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -3,7 +3,7 @@ #include "vcpkg_Strings.h" #include "filesystem_fs.h" -namespace vcpkg {namespace System +namespace vcpkg::System { fs::path get_exe_path_of_current_process(); @@ -93,4 +93,4 @@ namespace vcpkg {namespace System }; std::wstring wdupenv_str(const wchar_t* varname) noexcept; -}} +} diff --git a/toolsrc/src/vcpkg_Checks.cpp b/toolsrc/src/vcpkg_Checks.cpp index 817ac9e96..46b28e55c 100644 --- a/toolsrc/src/vcpkg_Checks.cpp +++ b/toolsrc/src/vcpkg_Checks.cpp @@ -3,7 +3,7 @@ #include <stdexcept> #include "vcpkg_System.h" -namespace vcpkg {namespace Checks +namespace vcpkg::Checks { void unreachable() { @@ -41,4 +41,4 @@ namespace vcpkg {namespace Checks exit_with_message(errorMessage); } } -}} +} diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 48283e43f..1d4faa773 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -3,7 +3,7 @@ #include <regex> #include "vcpkg_System.h" -namespace vcpkg {namespace Files +namespace vcpkg::Files { static const std::regex FILESYSTEM_INVALID_CHARACTERS_REGEX = std::regex(R"([\/:*?"<>|])"); @@ -140,4 +140,4 @@ namespace vcpkg {namespace Files } System::println(""); } -}} +} diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 46a4b1855..cf7d3b0ee 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -7,7 +7,7 @@ #include <functional> #include <cctype> -namespace vcpkg {namespace Strings {namespace details +namespace vcpkg::Strings::details { // To disambiguate between two overloads static const auto isspace = [](const char c) @@ -40,9 +40,9 @@ namespace vcpkg {namespace Strings {namespace details return output; } -}}} +} -namespace vcpkg {namespace Strings +namespace vcpkg::Strings { std::wstring utf8_to_utf16(const std::string& s) { @@ -119,4 +119,4 @@ namespace vcpkg {namespace Strings return s == ""; }), strings->end()); } -}} +} diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 43eae3412..405dfd1b8 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -3,7 +3,7 @@ #include <Windows.h> #include <regex> -namespace vcpkg {namespace System +namespace vcpkg::System { fs::path get_exe_path_of_current_process() { @@ -104,6 +104,6 @@ namespace vcpkg {namespace System double Stopwatch2::microseconds() const { return (reinterpret_cast<const LARGE_INTEGER*>(&end_time)->QuadPart - - reinterpret_cast<const LARGE_INTEGER*>(&start_time)->QuadPart) * 1000000.0 / reinterpret_cast<const LARGE_INTEGER*>(&freq)->QuadPart; + reinterpret_cast<const LARGE_INTEGER*>(&start_time)->QuadPart) * 1000000.0 / reinterpret_cast<const LARGE_INTEGER*>(&freq)->QuadPart; } -}} +} |
