change type naming style
authorJacob Lifshay <programmerjake@gmail.com>
Mon, 5 Jun 2017 01:56:11 +0000 (18:56 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Mon, 5 Jun 2017 01:56:11 +0000 (18:56 -0700)
15 files changed:
src/demo/demo.cpp
src/generate_spirv_parser/ast.h
src/generate_spirv_parser/generate_spirv_parser.cpp
src/generate_spirv_parser/parser.cpp
src/generate_spirv_parser/parser.h
src/json/json.cpp
src/json/json.h
src/json/parser.cpp
src/json/parser.h
src/spirv/spirv.h
src/util/invoke.h
src/util/is_swappable.h
src/util/optional.h
src/util/variant.h
src/util/void_t.h

index 65ebb1104f27ddf298968513bd8aec0c5901d381..601571fb299db19c33ed01047e7e43fb7b228c42 100644 (file)
@@ -33,22 +33,22 @@ namespace vulkan_cpu
 {
 namespace test
 {
-util::optional<std::vector<spirv::word>> load_file(const char *fileName)
+util::optional<std::vector<spirv::Word>> load_file(const char *fileName)
 {
-    using spirv::word;
+    using spirv::Word;
     constexpr int eof = std::char_traits<char>::eof();
     std::ifstream is;
     is.open(fileName, std::ios::in | std::ios::binary);
     if(!is)
         return {};
     constexpr std::size_t block_size = 0x1000;
-    std::vector<std::array<word, block_size>> blocks;
-    std::array<unsigned char, sizeof(word)> word_bytes{};
-    static_assert(sizeof(word) == 4, "");
+    std::vector<std::array<Word, block_size>> blocks;
+    std::array<unsigned char, sizeof(Word)> word_bytes{};
+    static_assert(sizeof(Word) == 4, "");
     static_assert(std::is_same<std::uint8_t, unsigned char>::value, "");
-    auto read_little_endian = [](const unsigned char *bytes) -> word
+    auto read_little_endian = [](const unsigned char *bytes) -> Word
     {
-        word retval = bytes[3];
+        Word retval = bytes[3];
         retval <<= 8;
         retval |= bytes[2];
         retval <<= 8;
@@ -57,9 +57,9 @@ util::optional<std::vector<spirv::word>> load_file(const char *fileName)
         retval |= bytes[0];
         return retval;
     };
-    auto read_big_endian = [](const unsigned char *bytes) -> word
+    auto read_big_endian = [](const unsigned char *bytes) -> Word
     {
-        word retval = bytes[0];
+        Word retval = bytes[0];
         retval <<= 8;
         retval |= bytes[1];
         retval <<= 8;
@@ -75,7 +75,7 @@ util::optional<std::vector<spirv::word>> load_file(const char *fileName)
             return {};
         byte = v;
     }
-    word (*read_word_fn)(const unsigned char *) = nullptr;
+    Word (*read_word_fn)(const unsigned char *) = nullptr;
     if(read_little_endian(word_bytes.data()) == spirv::magic_number)
         read_word_fn = read_little_endian;
     else if(read_big_endian(word_bytes.data()) == spirv::magic_number)
@@ -103,7 +103,7 @@ util::optional<std::vector<spirv::word>> load_file(const char *fileName)
             blocks.emplace_back();
         }
     }
-    std::vector<word> retval;
+    std::vector<Word> retval;
     retval.reserve(word_count);
     word_in_block_index = 0;
     for(std::size_t word_index = 0, block_index = 0; word_index < word_count; word_index++)
@@ -118,7 +118,7 @@ util::optional<std::vector<spirv::word>> load_file(const char *fileName)
     return std::move(retval);
 }
 
-void dump_words(const spirv::word *words, std::size_t word_count)
+void dump_words(const spirv::Word *words, std::size_t word_count)
 {
     constexpr std::size_t max_words_per_line = 4;
     auto old_fill = std::cout.fill('0');
@@ -141,8 +141,8 @@ void dump_words(const spirv::word *words, std::size_t word_count)
     std::string chars = "";
     auto write_line_ending = [&]()
     {
-       while(current_words_per_line < max_words_per_line)
-       {
+        while(current_words_per_line < max_words_per_line)
+        {
             std::cout << seperator;
             seperator = " ";
             std::cout.width(8);
@@ -150,8 +150,8 @@ void dump_words(const spirv::word *words, std::size_t word_count)
             std::cout << "";
             std::cout.fill('0');
             current_words_per_line++;
-       }
-       std::cout << seperator << " |" << chars << "|\n";
+        }
+        std::cout << seperator << " |" << chars << "|\n";
         seperator = "";
         wrote_line_ending = true;
         wrote_line_beginning = false;
@@ -160,12 +160,12 @@ void dump_words(const spirv::word *words, std::size_t word_count)
     };
     auto append_char = [&](unsigned ch)
     {
-       if(ch >= 0x20U && ch < 0x7FU)
-               chars += static_cast<char>(ch);
-       else
-               chars += '.';
+        if(ch >= 0x20U && ch < 0x7FU)
+            chars += static_cast<char>(ch);
+        else
+            chars += '.';
     };
-    auto write_word = [&](spirv::word w)
+    auto write_word = [&](spirv::Word w)
     {
         std::cout << seperator;
         seperator = " ";
@@ -193,7 +193,7 @@ void dump_words(const spirv::word *words, std::size_t word_count)
     std::cout.flags(old_flags);
 }
 
-void dump_words(const std::vector<spirv::word> &words)
+void dump_words(const std::vector<spirv::Word> &words)
 {
     dump_words(words.data(), words.size());
 }
index 1779c8aa1fa974110b2bb7fbc38e293c265d9169..5d59a95d2b63c0060fd0f3210e843fac21bc6d59 100644 (file)
@@ -33,43 +33,43 @@ namespace generate_spirv_parser
 {
 namespace ast
 {
-struct copyright
+struct Copyright
 {
-    json::ast::array value;
-    copyright() : value()
+    json::ast::Array value;
+    Copyright() : value()
     {
     }
-    explicit copyright(json::ast::array value) noexcept : value(std::move(value))
+    explicit Copyright(json::ast::Array value) noexcept : value(std::move(value))
     {
     }
 };
 
-struct instructions
+struct Instructions
 {
 #warning finish
 };
 
-struct operand_kinds
+struct Operand_kinds
 {
 #warning finish
 };
 
-struct top_level
+struct Top_level
 {
-    copyright copyright;
+    Copyright copyright;
     std::uint32_t magic_number;
     std::size_t major_version;
     std::size_t minor_version;
     std::size_t revision;
-    instructions instructions;
-    operand_kinds operand_kinds;
-    top_level(ast::copyright copyright,
+    Instructions instructions;
+    Operand_kinds operand_kinds;
+    Top_level(Copyright copyright,
               std::uint32_t magic_number,
               std::size_t major_version,
               std::size_t minor_version,
               std::size_t revision,
-              ast::instructions instructions,
-              ast::operand_kinds operand_kinds)
+              Instructions instructions,
+              Operand_kinds operand_kinds)
         : copyright(std::move(copyright)),
           magic_number(magic_number),
           major_version(major_version),
index feaa3c844a2092da71b8121d7f3a42cc1cd36163..eb48aeeb7570c00fa3394f2567d1627ab1d741dc 100644 (file)
@@ -42,18 +42,18 @@ int generate_spirv_parser_main(int argc, char **argv)
     }
     try
     {
-        auto source = file_name == "-" ? json::source::load_stdin() :
-                                         json::source::load_file(std::move(file_name));
+        auto source = file_name == "-" ? json::Source::load_stdin() :
+                                         json::Source::load_file(std::move(file_name));
         try
         {
             auto ast = parser::parse(json::parse(&source));
         }
-        catch(json::parse_error &e)
+        catch(json::Parse_error &e)
         {
             std::cerr << "error: " << e.what() << std::endl;
             return 1;
         }
-        catch(parser::parse_error &e)
+        catch(parser::Parse_error &e)
         {
             std::cerr << "error: " << e.what() << std::endl;
             return 1;
index 7596b92c3a0c6bbc07e0b8f0da773cb5c75769a5..ddaa34aa5fe9a4bd6b6cb9d38d6303b60128d451 100644 (file)
@@ -31,7 +31,7 @@ namespace generate_spirv_parser
 {
 namespace parser
 {
-std::string path::to_string() const
+std::string Path::to_string() const
 {
     std::ostringstream ss;
     ss << "root";
@@ -44,7 +44,7 @@ std::string path::to_string() const
         }
         else
         {
-            json::ast::string_value::write(ss, util::get<std::string>(e));
+            json::ast::String_value::write(ss, util::get<std::string>(e));
         }
         ss << ']';
     }
@@ -55,66 +55,66 @@ namespace
 {
 template <typename Value, std::size_t N>
 Value get_value_or_throw_parse_error(util::optional<Value> value,
-                                     path_builder_base *path_builder,
+                                     Path_builder_base *path_builder,
                                      const char(&message)[N])
 {
     if(value)
         return std::move(*value);
-    throw parse_error(path_builder ? path_builder->path() : path{}, message);
+    throw Parse_error(path_builder ? path_builder->path() : Path{}, message);
 }
 
-ast::copyright parse_copyright(json::ast::value value, const path_builder_base *parent_path_builder)
+ast::Copyright parse_copyright(json::ast::Value value, const Path_builder_base *parent_path_builder)
 {
-    if(json::ast::get_value_kind(value) != json::ast::value_kind::array)
-        throw parse_error(parent_path_builder->path(), "copyright is not an array");
+    if(json::ast::get_value_kind(value) != json::ast::Value_kind::array)
+        throw Parse_error(parent_path_builder->path(), "copyright is not an array");
     auto &copyright_array =
-        static_cast<json::ast::array &>(*util::get<json::ast::composite_value_pointer>(value));
+        static_cast<json::ast::Array &>(*util::get<json::ast::Composite_value_pointer>(value));
     for(std::size_t index = 0; index < copyright_array.values.size(); index++)
     {
-        path_builder<std::size_t> path_builder(&index, parent_path_builder);
+        Path_builder<std::size_t> path_builder(&index, parent_path_builder);
         auto &element = copyright_array.values[index];
-        if(json::ast::get_value_kind(element) != json::ast::value_kind::string)
-            throw parse_error(parent_path_builder->path(),
+        if(json::ast::get_value_kind(element) != json::ast::Value_kind::string)
+            throw Parse_error(parent_path_builder->path(),
                               "copyright array's element is not a string");
     }
-    return ast::copyright(std::move(copyright_array));
+    return ast::Copyright(std::move(copyright_array));
 }
 
-ast::operand_kinds parse_operand_kinds(json::ast::value value,
-                                       const path_builder_base *parent_path_builder)
+ast::Operand_kinds parse_operand_kinds(json::ast::Value value,
+                                       const Path_builder_base *parent_path_builder)
 {
-    if(json::ast::get_value_kind(value) != json::ast::value_kind::array)
-        throw parse_error(parent_path_builder->path(), "operand_kinds is not an array");
+    if(json::ast::get_value_kind(value) != json::ast::Value_kind::array)
+        throw Parse_error(parent_path_builder->path(), "operand_kinds is not an array");
     auto &operand_kinds_array =
-        static_cast<json::ast::array &>(*util::get<json::ast::composite_value_pointer>(value));
+        static_cast<json::ast::Array &>(*util::get<json::ast::Composite_value_pointer>(value));
     static_cast<void>(operand_kinds_array);
 #warning finish
-    return ast::operand_kinds();
+    return ast::Operand_kinds();
 }
 
-ast::instructions parse_instructions(json::ast::value value,
-                                     const path_builder_base *parent_path_builder)
+ast::Instructions parse_instructions(json::ast::Value value,
+                                     const Path_builder_base *parent_path_builder)
 {
-    if(json::ast::get_value_kind(value) != json::ast::value_kind::array)
-        throw parse_error(parent_path_builder->path(), "instructions is not an array");
+    if(json::ast::get_value_kind(value) != json::ast::Value_kind::array)
+        throw Parse_error(parent_path_builder->path(), "instructions is not an array");
     auto &instructions_array =
-        static_cast<json::ast::array &>(*util::get<json::ast::composite_value_pointer>(value));
+        static_cast<json::ast::Array &>(*util::get<json::ast::Composite_value_pointer>(value));
     static_cast<void>(instructions_array);
 #warning finish
-    return ast::instructions();
+    return ast::Instructions();
 }
 
 template <typename T>
-T parse_integer(const json::ast::value &value,
-                const path_builder_base *parent_path_builder,
+T parse_integer(const json::ast::Value &value,
+                const Path_builder_base *parent_path_builder,
                 const char *name)
 {
-    if(json::ast::get_value_kind(value) != json::ast::value_kind::number)
-        throw parse_error(parent_path_builder->path(), std::string(name) + " is not a number");
-    auto number_value = util::get<json::ast::number_value>(value);
+    if(json::ast::get_value_kind(value) != json::ast::Value_kind::number)
+        throw Parse_error(parent_path_builder->path(), std::string(name) + " is not a number");
+    auto number_value = util::get<json::ast::Number_value>(value);
     T retval = number_value.value;
     if(retval != number_value.value) // not an exact value
-        throw parse_error(parent_path_builder->path(), std::string(name) + " is not an integer");
+        throw Parse_error(parent_path_builder->path(), std::string(name) + " is not an integer");
     return retval;
 }
 
@@ -135,19 +135,19 @@ constexpr int get_digit_value(int ch, unsigned base) noexcept
 }
 
 template <typename T>
-T parse_hex_integer_string(const json::ast::value &value,
-                           const path_builder_base *parent_path_builder,
+T parse_hex_integer_string(const json::ast::Value &value,
+                           const Path_builder_base *parent_path_builder,
                            const char *name,
                            std::size_t min_length,
                            std::size_t max_length)
 {
-    if(json::ast::get_value_kind(value) != json::ast::value_kind::string)
-        throw parse_error(parent_path_builder->path(), std::string(name) + " is not a string");
-    auto &string_value = util::get<json::ast::string_value>(value);
+    if(json::ast::get_value_kind(value) != json::ast::Value_kind::string)
+        throw Parse_error(parent_path_builder->path(), std::string(name) + " is not a string");
+    auto &string_value = util::get<json::ast::String_value>(value);
     constexpr std::size_t hex_number_prefix_length = 2; // std::strlen("0x")
     if(string_value.value.size() < hex_number_prefix_length || string_value.value[0] != '0'
        || (string_value.value[1] != 'x' && string_value.value[1] != 'X'))
-        throw parse_error(parent_path_builder->path(),
+        throw Parse_error(parent_path_builder->path(),
                           std::string(name) + " is not a valid hex number in a string");
     constexpr T max_value = std::numeric_limits<T>::max();
     constexpr unsigned base = 0x10;
@@ -159,42 +159,42 @@ T parse_hex_integer_string(const json::ast::value &value,
         char ch = string_value.value[i];
         int digit = get_digit_value(ch, base);
         if(digit < 0)
-            throw parse_error(parent_path_builder->path(),
+            throw Parse_error(parent_path_builder->path(),
                               std::string(name) + ": not a valid hex digit");
         if(digit_count > max_length)
-            throw parse_error(parent_path_builder->path(),
+            throw Parse_error(parent_path_builder->path(),
                               std::string(name) + " has too many digits");
         if(retval > max_value / base
            || (retval = max_value / base && static_cast<unsigned>(digit) > max_value % base))
-            throw parse_error(parent_path_builder->path(), std::string(name) + ": value too big");
+            throw Parse_error(parent_path_builder->path(), std::string(name) + ": value too big");
         retval *= base;
         retval += digit;
     }
     if(digit_count < min_length)
-        throw parse_error(parent_path_builder->path(),
+        throw Parse_error(parent_path_builder->path(),
                           std::string(name) + " doesn't have enough digits");
     return retval;
 }
 }
 
-ast::top_level parse(json::ast::value &&top_level_value)
+ast::Top_level parse(json::ast::Value &&top_level_value)
 {
-    if(json::ast::get_value_kind(top_level_value) != json::ast::value_kind::object)
-        throw parse_error({}, "top level value is not an object");
-    auto &top_level_object = static_cast<const json::ast::object &>(
-        *util::get<json::ast::composite_value_pointer>(top_level_value));
-    util::optional<ast::copyright> copyright;
+    if(json::ast::get_value_kind(top_level_value) != json::ast::Value_kind::object)
+        throw Parse_error({}, "top level value is not an object");
+    auto &top_level_object = static_cast<const json::ast::Object &>(
+        *util::get<json::ast::Composite_value_pointer>(top_level_value));
+    util::optional<ast::Copyright> copyright;
     util::optional<std::uint32_t> magic_number;
     util::optional<std::size_t> major_version;
     util::optional<std::size_t> minor_version;
     util::optional<std::size_t> revision;
-    util::optional<ast::instructions> instructions;
-    util::optional<ast::operand_kinds> operand_kinds;
+    util::optional<ast::Instructions> instructions;
+    util::optional<ast::Operand_kinds> operand_kinds;
     for(auto &entry : top_level_object.values)
     {
         const auto &key = std::get<0>(entry);
         auto &entry_value = std::get<1>(entry);
-        path_builder<std::string> path_builder(&key, nullptr);
+        Path_builder<std::string> path_builder(&key, nullptr);
         if(key == "copyright")
         {
             copyright = parse_copyright(std::move(entry_value), &path_builder);
@@ -226,10 +226,10 @@ ast::top_level parse(json::ast::value &&top_level_value)
         }
         else
         {
-            throw parse_error(path_builder.path(), "unknown key");
+            throw Parse_error(path_builder.path(), "unknown key");
         }
     }
-    auto retval = ast::top_level(
+    auto retval = ast::Top_level(
         get_value_or_throw_parse_error(std::move(copyright), nullptr, "missing copyright"),
         get_value_or_throw_parse_error(magic_number, nullptr, "missing magic_number"),
         get_value_or_throw_parse_error(major_version, nullptr, "missing major_version"),
@@ -237,7 +237,7 @@ ast::top_level parse(json::ast::value &&top_level_value)
         get_value_or_throw_parse_error(revision, nullptr, "missing revision"),
         get_value_or_throw_parse_error(instructions, nullptr, "missing instructions"),
         get_value_or_throw_parse_error(operand_kinds, nullptr, "missing operand_kinds"));
-    throw parse_error({}, "not finished implementing");
+    throw Parse_error({}, "not finished implementing");
 }
 }
 }
index 67e86bb51b39cefe7a98031fd5815f84ef9f95a5..9ef3035401f63f626d6bc3ca5c8200940844eac8 100644 (file)
@@ -38,40 +38,40 @@ namespace generate_spirv_parser
 {
 namespace parser
 {
-struct path
+struct Path
 {
     typedef util::variant<std::size_t, std::string> element;
     std::vector<element> elements;
-    path() : elements()
+    Path() : elements()
     {
     }
-    path(std::vector<element> elements) : elements(std::move(elements))
+    Path(std::vector<element> elements) : elements(std::move(elements))
     {
     }
-    path(std::initializer_list<element> elements) : elements(elements)
+    Path(std::initializer_list<element> elements) : elements(elements)
     {
     }
     std::string to_string() const;
 };
 
-struct path_builder_base
+struct Path_builder_base
 {
-    path_builder_base(const path_builder_base &) = delete;
-    path_builder_base &operator=(const path_builder_base &) = delete;
-    virtual ~path_builder_base() = default;
-    const path_builder_base *const parent;
+    Path_builder_base(const Path_builder_base &) = delete;
+    Path_builder_base &operator=(const Path_builder_base &) = delete;
+    virtual ~Path_builder_base() = default;
+    const Path_builder_base *const parent;
     const std::size_t element_count;
-    explicit path_builder_base(const path_builder_base *parent) noexcept
+    explicit Path_builder_base(const Path_builder_base *parent) noexcept
         : parent(parent),
           element_count(parent ? parent->element_count + 1 : 1)
     {
     }
-    virtual path::element get_element() const = 0;
-    path path() const
+    virtual Path::element get_element() const = 0;
+    Path path() const
     {
-        std::vector<path::element> elements;
+        std::vector<Path::element> elements;
         elements.resize(element_count);
-        const path_builder_base *node = this;
+        const Path_builder_base *node = this;
         for(std::size_t i = 0, j = element_count - 1; i < element_count;
             i++, j--, node = node->parent)
         {
@@ -84,31 +84,31 @@ struct path_builder_base
 };
 
 template <typename T>
-struct path_builder final : public path_builder_base
+struct Path_builder final : public Path_builder_base
 {
     const T *value;
-    path_builder(const T *value, const path_builder_base *parent) noexcept
-        : path_builder_base(parent),
+    Path_builder(const T *value, const Path_builder_base *parent) noexcept
+        : Path_builder_base(parent),
           value(value)
     {
     }
-    virtual path::element get_element() const override
+    virtual Path::element get_element() const override
     {
         return *value;
     }
 };
 
-class parse_error : public std::runtime_error
+class Parse_error : public std::runtime_error
 {
 public:
-    path path;
-    parse_error(parser::path path, const std::string &message)
+    Path path;
+    Parse_error(parser::Path path, const std::string &message)
         : runtime_error("at " + path.to_string() + ": " + message), path(std::move(path))
     {
     }
 };
 
-ast::top_level parse(json::ast::value &&top_level_value);
+ast::Top_level parse(json::ast::Value &&top_level_value);
 }
 }
 }
index 1dfad8773093e4aa5e0afd9bd62080cb098de256..ad1582dd53d2dcab952c1a89d6db9a2332abaf66 100644 (file)
@@ -34,7 +34,7 @@ namespace vulkan_cpu
 {
 namespace json
 {
-void write_state::write_indent(std::ostream &os) const
+void Write_state::write_indent(std::ostream &os) const
 {
     for(std::size_t i = indent_level; i > 0; i--)
         os << options.indent_text;
@@ -44,12 +44,12 @@ namespace ast
 {
 namespace soft_float = util::soft_float;
 
-void null_value::write(std::ostream &os, write_state &state) const
+void Null_value::write(std::ostream &os, Write_state &state) const
 {
     os << "null";
 }
 
-void boolean_value::write(std::ostream &os, write_state &state) const
+void Boolean_value::write(std::ostream &os, Write_state &state) const
 {
     os << (value ? "true" : "false");
 }
@@ -66,7 +66,7 @@ constexpr char get_digit_char(unsigned digit, bool uppercase) noexcept
 }
 }
 
-void string_value::write(std::ostream &os, const std::string &value, write_state &state)
+void String_value::write(std::ostream &os, const std::string &value, Write_state &state)
 {
     os << '\"';
     for(unsigned char ch : value)
@@ -170,7 +170,7 @@ void write_unsigned_integer(Write_Char write_char,
                             std::uint64_t value,
                             unsigned base) noexcept(noexcept(write_char('0')))
 {
-    assert(base >= number_value::min_base && base <= number_value::max_base);
+    assert(base >= Number_value::min_base && base <= Number_value::max_base);
     char buffer[max_integer_buffer_size]{};
     std::size_t buffer_used = 0;
     do
@@ -209,7 +209,7 @@ void write_number(Write_Char write_char,
     // code modified from
     // https://github.com/programmerjake/javascript-tasklets/blob/master/javascript_tasklets/value.cpp
     // based on the ECMAScript ToString algorithm for numbers
-    assert(base >= number_value::min_base && base <= number_value::max_base);
+    assert(base >= Number_value::min_base && base <= Number_value::max_base);
     const char exponent_char = base == 10 ? 'e' : base == 16 ? 'h' : base == 8 ? 'o' : 'E';
     soft_float::ExtendedFloat value(valueIn), base_f(static_cast<std::uint64_t>(base));
     auto inv_base_f = soft_float::ExtendedFloat::One() / base_f;
@@ -344,7 +344,7 @@ void write_number(Write_Char write_char,
 }
 }
 
-std::string number_value::append_double_to_string(double value, std::string buffer, unsigned base)
+std::string Number_value::append_double_to_string(double value, std::string buffer, unsigned base)
 {
     write_number(
         [&](char ch)
@@ -356,7 +356,7 @@ std::string number_value::append_double_to_string(double value, std::string buff
     return buffer;
 }
 
-std::size_t number_value::double_to_buffer(double value,
+std::size_t Number_value::double_to_buffer(double value,
                                            char *output_buffer,
                                            std::size_t output_buffer_size,
                                            bool require_null_terminator,
@@ -381,7 +381,7 @@ std::size_t number_value::double_to_buffer(double value,
     return used_buffer_size; // report used buffer excluding the null terminator
 }
 
-std::string number_value::append_unsigned_integer_to_string(std::uint64_t value,
+std::string Number_value::append_unsigned_integer_to_string(std::uint64_t value,
                                                             std::string buffer,
                                                             unsigned base)
 {
@@ -395,7 +395,7 @@ std::string number_value::append_unsigned_integer_to_string(std::uint64_t value,
     return buffer;
 }
 
-std::size_t number_value::unsigned_integer_to_buffer(std::uint64_t value,
+std::size_t Number_value::unsigned_integer_to_buffer(std::uint64_t value,
                                                      char *output_buffer,
                                                      std::size_t output_buffer_size,
                                                      bool require_null_terminator,
@@ -420,7 +420,7 @@ std::size_t number_value::unsigned_integer_to_buffer(std::uint64_t value,
     return used_buffer_size; // report used buffer excluding the null terminator
 }
 
-std::string number_value::append_signed_integer_to_string(std::int64_t value,
+std::string Number_value::append_signed_integer_to_string(std::int64_t value,
                                                           std::string buffer,
                                                           unsigned base)
 {
@@ -434,7 +434,7 @@ std::string number_value::append_signed_integer_to_string(std::int64_t value,
     return buffer;
 }
 
-std::size_t number_value::signed_integer_to_buffer(std::int64_t value,
+std::size_t Number_value::signed_integer_to_buffer(std::int64_t value,
                                                    char *output_buffer,
                                                    std::size_t output_buffer_size,
                                                    bool require_null_terminator,
@@ -459,7 +459,7 @@ std::size_t number_value::signed_integer_to_buffer(std::int64_t value,
     return used_buffer_size; // report used buffer excluding the null terminator
 }
 
-void number_value::write(std::ostream &os, write_state &state, unsigned base) const
+void Number_value::write(std::ostream &os, Write_state &state, unsigned base) const
 {
     write_number(
         [&](char ch)
@@ -470,17 +470,17 @@ void number_value::write(std::ostream &os, write_state &state, unsigned base) co
         base);
 }
 
-void object::write(std::ostream &os, write_state &state) const
+void Object::write(std::ostream &os, Write_state &state) const
 {
     os << '{';
     if(!values.empty())
     {
-        write_state::push_indent push_indent(state);
+        Write_state::Push_indent push_indent(state);
         auto seperator = "";
-        auto write_entry = [&](const std::pair<std::string, value> &entry)
+        auto write_entry = [&](const std::pair<std::string, Value> &entry)
         {
             const std::string &key = std::get<0>(entry);
-            const value &value = std::get<1>(entry);
+            const Value &value = std::get<1>(entry);
             os << seperator;
             seperator = ",";
             if(state.options.composite_value_elements_on_seperate_lines)
@@ -488,7 +488,7 @@ void object::write(std::ostream &os, write_state &state) const
                 os << '\n';
                 state.write_indent(os);
             }
-            string_value::write(os, key, state);
+            String_value::write(os, key, state);
             os << ':';
             json::write(os, value, state);
         };
@@ -522,14 +522,14 @@ void object::write(std::ostream &os, write_state &state) const
     os << '}';
 }
 
-void array::write(std::ostream &os, write_state &state) const
+void Array::write(std::ostream &os, Write_state &state) const
 {
     os << '[';
     if(!values.empty())
     {
-        write_state::push_indent push_indent(state);
+        Write_state::Push_indent push_indent(state);
         auto seperator = "";
-        for(const value &v : values)
+        for(const Value &v : values)
         {
             os << seperator;
             seperator = ",";
index 8ac3070bd24992613c2dae8c4f820ae9291bc4b2..d32acdc343bfd7e49ed65f7ce134bddbf377e5d6 100644 (file)
@@ -39,15 +39,15 @@ namespace vulkan_cpu
 {
 namespace json
 {
-struct write_options
+struct Write_options
 {
     bool composite_value_elements_on_seperate_lines = false;
     bool sort_object_values = false;
     std::string indent_text = "";
-    write_options()
+    Write_options()
     {
     }
-    write_options(bool composite_value_elements_on_seperate_lines,
+    Write_options(bool composite_value_elements_on_seperate_lines,
                   bool sort_object_values,
                   std::string indent_text) noexcept
         : composite_value_elements_on_seperate_lines(composite_value_elements_on_seperate_lines),
@@ -55,31 +55,31 @@ struct write_options
           indent_text(std::move(indent_text))
     {
     }
-    static write_options defaults()
+    static Write_options defaults()
     {
         return {};
     }
-    static write_options pretty(std::string indent_text = "    ")
+    static Write_options pretty(std::string indent_text = "    ")
     {
-        return write_options(true, true, std::move(indent_text));
+        return Write_options(true, true, std::move(indent_text));
     }
 };
 
-struct write_state
+struct Write_state
 {
-    write_options options;
+    Write_options options;
     std::size_t indent_level = 0;
-    class push_indent final
+    class Push_indent final
     {
-        push_indent(const push_indent &) = delete;
-        push_indent &operator=(const push_indent &) = delete;
+        Push_indent(const Push_indent &) = delete;
+        Push_indent &operator=(const Push_indent &) = delete;
 
     private:
-        write_state &state;
+        Write_state &state;
         bool finished = false;
 
     public:
-        push_indent(write_state &state) : state(state)
+        Push_indent(Write_state &state) : state(state)
         {
             state.indent_level++;
         }
@@ -89,13 +89,13 @@ struct write_state
             state.indent_level--;
             finished = true;
         }
-        ~push_indent()
+        ~Push_indent()
         {
             if(!finished)
                 state.indent_level--;
         }
     };
-    write_state(write_options options) : options(std::move(options))
+    Write_state(Write_options options) : options(std::move(options))
     {
     }
     void write_indent(std::ostream &os) const;
@@ -103,7 +103,7 @@ struct write_state
 
 namespace ast
 {
-enum class value_kind
+enum class Value_kind
 {
     null,
     boolean,
@@ -113,96 +113,96 @@ enum class value_kind
     array
 };
 
-struct null_value final
+struct Null_value final
 {
-    constexpr null_value() noexcept = default;
-    constexpr null_value(std::nullptr_t) noexcept
+    constexpr Null_value() noexcept = default;
+    constexpr Null_value(std::nullptr_t) noexcept
     {
     }
-    void write(std::ostream &os, write_state &state) const;
-    null_value duplicate() const noexcept
+    void write(std::ostream &os, Write_state &state) const;
+    Null_value duplicate() const noexcept
     {
         return {};
     }
-    const null_value *operator->() const noexcept
+    const Null_value *operator->() const noexcept
     {
         return this;
     }
-    const null_value &operator*() const noexcept
+    const Null_value &operator*() const noexcept
     {
         return *this;
     }
-    constexpr value_kind get_value_kind() const noexcept
+    constexpr Value_kind get_value_kind() const noexcept
     {
-        return value_kind::null;
+        return Value_kind::null;
     }
 };
 
-struct boolean_value final
+struct Boolean_value final
 {
     bool value;
     template <typename T, typename = typename std::enable_if<std::is_same<T, bool>::value>::type>
-    constexpr boolean_value(T value) noexcept : value(value)
+    constexpr Boolean_value(T value) noexcept : value(value)
     {
     }
-    void write(std::ostream &os, write_state &state) const;
-    boolean_value duplicate() const noexcept
+    void write(std::ostream &os, Write_state &state) const;
+    Boolean_value duplicate() const noexcept
     {
         return *this;
     }
-    const boolean_value *operator->() const noexcept
+    const Boolean_value *operator->() const noexcept
     {
         return this;
     }
-    const boolean_value &operator*() const noexcept
+    const Boolean_value &operator*() const noexcept
     {
         return *this;
     }
-    constexpr value_kind get_value_kind() const noexcept
+    constexpr Value_kind get_value_kind() const noexcept
     {
-        return value_kind::boolean;
+        return Value_kind::boolean;
     }
 };
 
-struct string_value final
+struct String_value final
 {
     std::string value;
     template <
         typename T,
         typename = typename std::enable_if<!std::is_same<T, std::nullptr_t>::value
                                            && std::is_convertible<T, std::string>::value>::type>
-    string_value(T value) noexcept : value(std::move(value))
+    String_value(T value) noexcept : value(std::move(value))
     {
     }
-    static void write(std::ostream &os, const std::string &value, write_state &state);
+    static void write(std::ostream &os, const std::string &value, Write_state &state);
     static void write(std::ostream &os, const std::string &value)
     {
-        write_state state(write_options::defaults());
+        Write_state state(Write_options::defaults());
         write(os, value, state);
     }
-    void write(std::ostream &os, write_state &state) const
+    void write(std::ostream &os, Write_state &state) const
     {
         write(os, value, state);
     }
-    string_value duplicate() const noexcept
+    String_value duplicate() const noexcept
     {
         return *this;
     }
-    const string_value *operator->() const noexcept
+    const String_value *operator->() const noexcept
     {
         return this;
     }
-    const string_value &operator*() const noexcept
+    const String_value &operator*() const noexcept
     {
         return *this;
     }
-    constexpr value_kind get_value_kind() const noexcept
+    constexpr Value_kind get_value_kind() const noexcept
     {
-        return value_kind::string;
+        return Value_kind::string;
     }
 };
 
-struct number_value final
+struct Number_value final
 {
     double value;
     static_assert(std::numeric_limits<double>::is_iec559 && std::numeric_limits<double>::radix == 2,
@@ -210,7 +210,7 @@ struct number_value final
     template <typename T,
               typename = typename std::enable_if<std::is_arithmetic<T>::value
                                                  && !std::is_same<T, bool>::value>::type>
-    number_value(T value) noexcept : value(value)
+    Number_value(T value) noexcept : value(value)
     {
     }
     explicit operator std::string() const
@@ -281,138 +281,138 @@ struct number_value final
                                         std::size_t output_buffer_size,
                                         bool require_null_terminator = true,
                                         unsigned base = default_base) noexcept;
-    void write(std::ostream &os, write_state &state, unsigned base = default_base) const;
-    number_value duplicate() const noexcept
+    void write(std::ostream &os, Write_state &state, unsigned base = default_base) const;
+    Number_value duplicate() const noexcept
     {
         return *this;
     }
-    const number_value *operator->() const noexcept
+    const Number_value *operator->() const noexcept
     {
         return this;
     }
-    const number_value &operator*() const noexcept
+    const Number_value &operator*() const noexcept
     {
         return *this;
     }
-    constexpr value_kind get_value_kind() const noexcept
+    constexpr Value_kind get_value_kind() const noexcept
     {
-        return value_kind::number;
+        return Value_kind::number;
     }
 };
 
-struct composite_value;
+struct Composite_value;
 
-class composite_value_pointer
+class Composite_value_pointer
 {
 private:
-    std::shared_ptr<composite_value> value;
+    std::shared_ptr<Composite_value> value;
 
 public:
-    constexpr composite_value_pointer() noexcept = default;
+    constexpr Composite_value_pointer() noexcept = default;
     template <typename T,
-              typename = typename std::enable_if<std::is_base_of<composite_value, T>::value>::type>
-    composite_value_pointer(std::shared_ptr<T> value) noexcept : value(std::move(value))
+              typename = typename std::enable_if<std::is_base_of<Composite_value, T>::value>::type>
+    Composite_value_pointer(std::shared_ptr<T> value) noexcept : value(std::move(value))
     {
     }
-    composite_value *operator->() const noexcept
+    Composite_value *operator->() const noexcept
     {
         return value.operator->();
     }
-    composite_value &operator*() const noexcept
+    Composite_value &operator*() const noexcept
     {
         return *value;
     }
-    const std::shared_ptr<composite_value> &get() const &noexcept
+    const std::shared_ptr<Composite_value> &get() const &noexcept
     {
         return value;
     }
-    std::shared_ptr<composite_value> get() && noexcept
+    std::shared_ptr<Composite_value> get() && noexcept
     {
-        std::shared_ptr<composite_value> retval = nullptr;
+        std::shared_ptr<Composite_value> retval = nullptr;
         retval.swap(value);
         return retval;
     }
 };
 
 typedef util::
-    variant<null_value, boolean_value, string_value, number_value, composite_value_pointer> value;
+    variant<Null_value, Boolean_value, String_value, Number_value, Composite_value_pointer> Value;
 
-struct composite_value
+struct Composite_value
 {
-    composite_value() = default;
-    virtual ~composite_value() = default;
-    virtual void write(std::ostream &os, write_state &state) const = 0;
-    virtual composite_value_pointer duplicate() const = 0;
-    operator value() const
+    Composite_value() = default;
+    virtual ~Composite_value() = default;
+    virtual void write(std::ostream &os, Write_state &state) const = 0;
+    virtual Composite_value_pointer duplicate() const = 0;
+    operator Value() const
     {
         return duplicate();
     }
-    virtual value_kind get_value_kind() const noexcept = 0;
+    virtual Value_kind get_value_kind() const noexcept = 0;
 };
 
-inline value duplicate(const value &v)
+inline Value duplicate(const Value &v)
 {
     return util::visit(
-        [](const auto &v) -> value
+        [](const auto &v) -> Value
         {
             return v->duplicate();
         },
         v);
 }
 
-struct object final : public composite_value
+struct Object final : public Composite_value
 {
-    std::unordered_map<std::string, value> values;
-    object() : values()
+    std::unordered_map<std::string, Value> values;
+    Object() : values()
     {
     }
-    object(std::unordered_map<std::string, value> values) noexcept : values(std::move(values))
+    Object(std::unordered_map<std::string, Value> values) noexcept : values(std::move(values))
     {
     }
-    virtual void write(std::ostream &os, write_state &state) const override;
-    virtual composite_value_pointer duplicate() const override
+    virtual void write(std::ostream &os, Write_state &state) const override;
+    virtual Composite_value_pointer duplicate() const override
     {
-        std::unordered_map<std::string, value> new_values;
+        std::unordered_map<std::string, Value> new_values;
         for(auto &entry : values)
         {
             new_values.emplace(std::get<0>(entry), ast::duplicate(std::get<1>(entry)));
         }
-        return std::make_shared<object>(std::move(new_values));
+        return std::make_shared<Object>(std::move(new_values));
     }
-    value_kind get_value_kind() const noexcept override
+    Value_kind get_value_kind() const noexcept override
     {
-        return value_kind::object;
+        return Value_kind::object;
     }
 };
 
-struct array final : public composite_value
+struct Array final : public Composite_value
 {
-    std::vector<value> values;
-    array() : values()
+    std::vector<Value> values;
+    Array() : values()
     {
     }
-    array(std::vector<value> values) noexcept : values(std::move(values))
+    Array(std::vector<Value> values) noexcept : values(std::move(values))
     {
     }
-    virtual void write(std::ostream &os, write_state &state) const override;
-    virtual composite_value_pointer duplicate() const override
+    virtual void write(std::ostream &os, Write_state &state) const override;
+    virtual Composite_value_pointer duplicate() const override
     {
-        std::vector<value> new_values;
+        std::vector<Value> new_values;
         new_values.reserve(values.size());
         for(auto &value : values)
             new_values.emplace_back(ast::duplicate(value));
-        return std::make_shared<array>(std::move(new_values));
+        return std::make_shared<Array>(std::move(new_values));
     }
-    value_kind get_value_kind() const noexcept override
+    Value_kind get_value_kind() const noexcept override
     {
-        return value_kind::array;
+        return Value_kind::array;
     }
 };
 
-inline value_kind get_value_kind(const value &v) noexcept
+inline Value_kind get_value_kind(const Value &v) noexcept
 {
     return util::visit(
-        [&](const auto &v) -> value_kind
+        [&](const auto &v) -> Value_kind
         {
             return v->get_value_kind();
         },
@@ -420,7 +420,7 @@ inline value_kind get_value_kind(const value &v) noexcept
 }
 }
 
-inline void write(std::ostream &os, const ast::value &v, write_state &state)
+inline void write(std::ostream &os, const ast::Value &v, Write_state &state)
 {
     util::visit(
         [&](const auto &v) -> void
@@ -430,9 +430,9 @@ inline void write(std::ostream &os, const ast::value &v, write_state &state)
         v);
 }
 
-inline void write(std::ostream &os, const ast::value &v, write_options options = {})
+inline void write(std::ostream &os, const ast::Value &v, Write_options options = {})
 {
-    write_state state(std::move(options));
+    Write_state state(std::move(options));
     write(os, v, state);
 }
 }
index 56a25deb97a42e11ad7cebf66bddc88179a4ed99..36ed166d5e450598252a2e76173a4963ea44426a 100644 (file)
@@ -68,7 +68,7 @@ void find_line_start_indexes_helper(Add_Index &&add_index,
 }
 }
 
-std::vector<std::size_t> source::find_line_start_indexes(const char *contents,
+std::vector<std::size_t> Source::find_line_start_indexes(const char *contents,
                                                          std::size_t contents_size)
 {
     std::size_t retval_size = 0;
@@ -91,7 +91,7 @@ std::vector<std::size_t> source::find_line_start_indexes(const char *contents,
     return retval;
 }
 
-source source::load_file(std::string file_name)
+Source Source::load_file(std::string file_name)
 {
     // TODO: add code to use mmap
     std::ifstream is;
@@ -109,10 +109,10 @@ source source::load_file(std::string file_name)
     std::size_t contents_size = buffer.size();
     auto buffer_ptr = std::make_shared<std::vector<char>>(std::move(buffer));
     std::shared_ptr<const char> contents(buffer_ptr, buffer_ptr->data());
-    return source(std::move(file_name), std::move(contents), contents_size);
+    return Source(std::move(file_name), std::move(contents), contents_size);
 }
 
-source source::load_stdin()
+Source Source::load_stdin()
 {
     auto &is = std::cin;
     is.clear();
@@ -139,16 +139,16 @@ source source::load_stdin()
     std::size_t contents_size = buffer.size();
     auto buffer_ptr = std::make_shared<std::vector<char>>(std::move(buffer));
     std::shared_ptr<const char> contents(buffer_ptr, buffer_ptr->data());
-    return source("stdin", std::move(contents), contents_size);
+    return Source("stdin", std::move(contents), contents_size);
 }
 
-std::ostream &operator<<(std::ostream &os, const source::line_and_column &v)
+std::ostream &operator<<(std::ostream &os, const Source::Line_and_column &v)
 {
     os << v.to_string();
     return os;
 }
 
-source::line_and_index source::get_line_and_start_index(std::size_t char_index) const noexcept
+Source::Line_and_index Source::get_line_and_start_index(std::size_t char_index) const noexcept
 {
     std::size_t line =
         1 + line_start_indexes.size()
@@ -156,7 +156,7 @@ source::line_and_index source::get_line_and_start_index(std::size_t char_index)
                                                           line_start_indexes.rend(),
                                                           char_index,
                                                           std::greater<std::size_t>()));
-    return line_and_index(line, line <= 1 ? 0 : line_start_indexes[line - 2]);
+    return Line_and_index(line, line <= 1 ? 0 : line_start_indexes[line - 2]);
 }
 
 namespace
@@ -168,7 +168,7 @@ constexpr std::size_t get_column_after_tab(std::size_t column, std::size_t tab_s
 }
 }
 
-source::line_and_column source::get_line_and_column(std::size_t char_index,
+Source::Line_and_column Source::get_line_and_column(std::size_t char_index,
                                                     std::size_t tab_size) const noexcept
 {
     auto line_and_start_index = get_line_and_start_index(char_index);
@@ -181,10 +181,10 @@ source::line_and_column source::get_line_and_column(std::size_t char_index,
         else
             column++;
     }
-    return line_and_column(line_and_start_index.line, column);
+    return Line_and_column(line_and_start_index.line, column);
 }
 
-std::ostream &operator<<(std::ostream &os, const location &v)
+std::ostream &operator<<(std::ostream &os, const Location &v)
 {
     os << v.to_string();
     return os;
@@ -192,7 +192,7 @@ std::ostream &operator<<(std::ostream &os, const location &v)
 
 namespace
 {
-enum class token_type
+enum class Token_type
 {
     eof,
     l_bracket,
@@ -208,18 +208,18 @@ enum class token_type
     number,
 };
 
-class tokenizer final
+class Tokenizer final
 {
 private:
     std::size_t input_char_index;
     static constexpr int eof = std::char_traits<char>::eof();
 
 public:
-    const source *const source;
-    const parse_options options;
-    location token_location;
-    ast::value token_value;
-    token_type token_type;
+    const Source *const source;
+    const Parse_options options;
+    Location token_location;
+    ast::Value token_value;
+    Token_type token_type;
 
 private:
     int peekc() const noexcept
@@ -284,7 +284,7 @@ private:
             int digit_char = peekc();
             int digit_value = get_digit_value(digit_char, 0x10);
             if(digit_value < 0)
-                throw parse_error(location(source, input_char_index), "missing hex digit");
+                throw Parse_error(Location(source, input_char_index), "missing hex digit");
             getc();
             retval <<= 4;
             retval |= digit_value;
@@ -319,12 +319,12 @@ private:
     }
 
 public:
-    tokenizer(const json::source *source, parse_options options)
+    Tokenizer(const json::Source *source, Parse_options options)
         : input_char_index(0), source(source), options(options), token_location(), token_value()
     {
         next();
     }
-    ast::value get()
+    ast::Value get()
     {
         auto retval = token_value;
         next();
@@ -334,7 +334,7 @@ public:
     {
         while(is_whitespace(peekc()))
             getc();
-        token_location = location(source, input_char_index);
+        token_location = Location(source, input_char_index);
         token_value = nullptr;
         bool got_minus = false, got_plus = false;
         if(peekc() == '-')
@@ -361,19 +361,19 @@ public:
                 if(match_buffer_with_string(name, name_size, "null"))
                 {
                     token_value = nullptr;
-                    token_type = json::token_type::null_literal;
+                    token_type = json::Token_type::null_literal;
                     return;
                 }
                 if(match_buffer_with_string(name, name_size, "false"))
                 {
                     token_value = false;
-                    token_type = json::token_type::false_literal;
+                    token_type = json::Token_type::false_literal;
                     return;
                 }
                 if(match_buffer_with_string(name, name_size, "true"))
                 {
                     token_value = true;
-                    token_type = json::token_type::true_literal;
+                    token_type = json::Token_type::true_literal;
                     return;
                 }
             }
@@ -384,7 +384,7 @@ public:
                    || match_buffer_with_string(name, name_size, "NAN"))
                 {
                     token_value = std::numeric_limits<double>::quiet_NaN();
-                    token_type = json::token_type::number;
+                    token_type = json::Token_type::number;
                     return;
                 }
                 if(match_buffer_with_string(name, name_size, "Infinity")
@@ -395,11 +395,11 @@ public:
                 {
                     token_value = got_minus ? -std::numeric_limits<double>::infinity() :
                                               std::numeric_limits<double>::infinity();
-                    token_type = json::token_type::number;
+                    token_type = json::Token_type::number;
                     return;
                 }
             }
-            throw parse_error(token_location,
+            throw Parse_error(token_location,
                               (got_minus || got_plus ? "invalid number: " : "invalid identifier: ")
                                   + std::string(name, name_size));
         }
@@ -415,7 +415,7 @@ public:
                     getc();
                     got_any_digit = true;
                     if(is_digit(peekc()))
-                        throw parse_error(location(source, input_char_index),
+                        throw Parse_error(Location(source, input_char_index),
                                           "extra leading zero not allowed in numbers");
                 }
                 else
@@ -443,7 +443,7 @@ public:
                 }
             }
             if(!got_any_digit)
-                throw parse_error(location(source, input_char_index), "missing digit");
+                throw Parse_error(Location(source, input_char_index), "missing digit");
             std::int64_t exponent = 0;
             if(peekc() == 'e' || peekc() == 'E')
             {
@@ -459,7 +459,7 @@ public:
                     getc();
                 }
                 if(!is_digit(peekc()))
-                    throw parse_error(location(source, input_char_index), "missing digit");
+                    throw Parse_error(Location(source, input_char_index), "missing digit");
                 while(is_digit(peekc()))
                 {
                     exponent *= 10;
@@ -472,7 +472,7 @@ public:
             auto value =
                 mantissa
                 * pow(util::soft_float::ExtendedFloat(static_cast<std::uint64_t>(10)), exponent);
-            token_type = json::token_type::number;
+            token_type = json::Token_type::number;
             token_value = static_cast<double>(value);
             return;
         }
@@ -483,7 +483,7 @@ public:
             while(true)
             {
                 if(peekc() == eof || is_control_character(peekc()))
-                    throw parse_error(token_location, "string missing closing quote");
+                    throw Parse_error(token_location, "string missing closing quote");
                 if(peekc() == quote)
                 {
                     getc();
@@ -491,7 +491,7 @@ public:
                 }
                 if(peekc() == '\\')
                 {
-                    auto escape_location = location(source, input_char_index);
+                    auto escape_location = Location(source, input_char_index);
                     getc();
                     switch(peekc())
                     {
@@ -526,7 +526,7 @@ public:
                         std::uint32_t ch = parse_4_hex_digits();
                         if(ch >= 0xD800U && ch < 0xDC00U && peekc() == '\\')
                         {
-                            escape_location = location(source, input_char_index);
+                            escape_location = Location(source, input_char_index);
                             getc();
                             if(peekc() == 'u')
                             {
@@ -556,7 +556,7 @@ public:
                             value += getc();
                             break;
                         }
-                        throw parse_error(escape_location, "invalid escape sequence");
+                        throw Parse_error(escape_location, "invalid escape sequence");
                     }
                 }
                 else
@@ -564,68 +564,68 @@ public:
                     value += getc();
                 }
             }
-            token_type = json::token_type::string;
+            token_type = json::Token_type::string;
             token_value = std::move(value);
             return;
         }
         switch(peekc())
         {
         case eof:
-            token_type = json::token_type::eof;
+            token_type = json::Token_type::eof;
             token_value = nullptr;
             return;
         case '[':
             getc();
-            token_type = json::token_type::l_bracket;
+            token_type = json::Token_type::l_bracket;
             token_value = nullptr;
             return;
         case ']':
             getc();
-            token_type = json::token_type::r_bracket;
+            token_type = json::Token_type::r_bracket;
             token_value = nullptr;
             return;
         case '{':
             getc();
-            token_type = json::token_type::l_brace;
+            token_type = json::Token_type::l_brace;
             token_value = nullptr;
             return;
         case '}':
             getc();
-            token_type = json::token_type::r_brace;
+            token_type = json::Token_type::r_brace;
             token_value = nullptr;
             return;
         case ':':
             getc();
-            token_type = json::token_type::colon;
+            token_type = json::Token_type::colon;
             token_value = nullptr;
             return;
         case ',':
             getc();
-            token_type = json::token_type::comma;
+            token_type = json::Token_type::comma;
             token_value = nullptr;
             return;
         }
-        throw parse_error(token_location, "invalid character");
+        throw Parse_error(token_location, "invalid character");
     }
 };
 
-ast::value parse_value(tokenizer &tokenizer)
+ast::Value parse_value(Tokenizer &tokenizer)
 {
     switch(tokenizer.token_type)
     {
-    case token_type::eof:
-        throw parse_error(tokenizer.token_location, "missing value");
-    case token_type::number:
-    case token_type::string:
-    case token_type::true_literal:
-    case token_type::false_literal:
-    case token_type::null_literal:
+    case Token_type::eof:
+        throw Parse_error(tokenizer.token_location, "missing value");
+    case Token_type::number:
+    case Token_type::string:
+    case Token_type::true_literal:
+    case Token_type::false_literal:
+    case Token_type::null_literal:
         return tokenizer.get();
-    case token_type::l_bracket:
+    case Token_type::l_bracket:
     {
-        std::vector<ast::value> values;
+        std::vector<ast::Value> values;
         tokenizer.next();
-        if(tokenizer.token_type == token_type::r_bracket)
+        if(tokenizer.token_type == Token_type::r_bracket)
         {
             tokenizer.next();
         }
@@ -634,26 +634,26 @@ ast::value parse_value(tokenizer &tokenizer)
             while(true)
             {
                 values.push_back(parse_value(tokenizer));
-                if(tokenizer.token_type == token_type::comma)
+                if(tokenizer.token_type == Token_type::comma)
                 {
                     tokenizer.next();
                     continue;
                 }
-                if(tokenizer.token_type == token_type::r_bracket)
+                if(tokenizer.token_type == Token_type::r_bracket)
                 {
                     tokenizer.next();
                     break;
                 }
-                throw parse_error(tokenizer.token_location, "missing , or ]");
+                throw Parse_error(tokenizer.token_location, "missing , or ]");
             }
         }
-        return ast::array(std::move(values));
+        return ast::Array(std::move(values));
     }
-    case token_type::l_brace:
+    case Token_type::l_brace:
     {
-        std::unordered_map<std::string, ast::value> values;
+        std::unordered_map<std::string, ast::Value> values;
         tokenizer.next();
-        if(tokenizer.token_type == token_type::r_brace)
+        if(tokenizer.token_type == Token_type::r_brace)
         {
             tokenizer.next();
         }
@@ -661,41 +661,41 @@ ast::value parse_value(tokenizer &tokenizer)
         {
             while(true)
             {
-                if(tokenizer.token_type != token_type::string)
-                    throw parse_error(tokenizer.token_location, "missing string");
-                auto string_value = std::move(util::get<ast::string_value>(tokenizer.get()).value);
-                if(tokenizer.token_type != token_type::colon)
-                    throw parse_error(tokenizer.token_location, "missing ':'");
+                if(tokenizer.token_type != Token_type::string)
+                    throw Parse_error(tokenizer.token_location, "missing string");
+                auto string_value = std::move(util::get<ast::String_value>(tokenizer.get()).value);
+                if(tokenizer.token_type != Token_type::colon)
+                    throw Parse_error(tokenizer.token_location, "missing ':'");
                 tokenizer.next();
                 values.emplace(std::move(string_value), parse_value(tokenizer));
-                if(tokenizer.token_type == token_type::comma)
+                if(tokenizer.token_type == Token_type::comma)
                 {
                     tokenizer.next();
                     continue;
                 }
-                if(tokenizer.token_type == token_type::r_brace)
+                if(tokenizer.token_type == Token_type::r_brace)
                 {
                     tokenizer.next();
                     break;
                 }
-                throw parse_error(tokenizer.token_location, "missing ',' or '}'");
+                throw Parse_error(tokenizer.token_location, "missing ',' or '}'");
             }
         }
-        return ast::object(std::move(values));
+        return ast::Object(std::move(values));
     }
     default:
         break;
     }
-    throw parse_error(tokenizer.token_location, "token not allowed here");
+    throw Parse_error(tokenizer.token_location, "token not allowed here");
 }
 }
 
-ast::value parse(const source *source, parse_options options)
+ast::Value parse(const Source *source, Parse_options options)
 {
-    tokenizer tokenizer(source, options);
+    Tokenizer tokenizer(source, options);
     auto retval = parse_value(tokenizer);
-    if(tokenizer.token_type != token_type::eof)
-        throw parse_error(tokenizer.token_location, "unexpected token");
+    if(tokenizer.token_type != Token_type::eof)
+        throw Parse_error(tokenizer.token_location, "unexpected token");
     return retval;
 }
 }
index 747a404fde06da4a4d637ac30b3286ae707bfedc..ddc3ae58e66ae8f0d9f10ca8de11ecdcea7e4c14 100644 (file)
@@ -36,7 +36,7 @@ namespace vulkan_cpu
 {
 namespace json
 {
-struct source
+struct Source
 {
     std::string file_name;
     std::shared_ptr<const char> contents; // use a shared_ptr so you can use mmap-ed memory
@@ -45,20 +45,20 @@ struct source
     std::vector<std::size_t> line_start_indexes;
     static std::vector<std::size_t> find_line_start_indexes(const char *contents,
                                                             std::size_t contents_size);
-    source(source &&) = default;
-    source(const source &) = delete;
-    source &operator=(source &&) = default;
-    source &operator=(const source &) = delete;
-    source() : file_name(), contents(), contents_size(0), line_start_indexes()
+    Source(Source &&) = default;
+    Source(const Source &) = delete;
+    Source &operator=(Source &&) = default;
+    Source &operator=(const Source &) = delete;
+    Source() : file_name(), contents(), contents_size(0), line_start_indexes()
     {
     }
-    explicit source(std::string file_name) noexcept : file_name(std::move(file_name)),
+    explicit Source(std::string file_name) noexcept : file_name(std::move(file_name)),
                                                       contents(),
                                                       contents_size(0),
                                                       line_start_indexes()
     {
     }
-    source(std::string file_name,
+    Source(std::string file_name,
            std::shared_ptr<const char> contents,
            std::size_t contents_size) noexcept
         : file_name(std::move(file_name)),
@@ -67,7 +67,7 @@ struct source
           line_start_indexes(find_line_start_indexes(this->contents.get(), contents_size))
     {
     }
-    source(std::string file_name, std::string contents_in)
+    Source(std::string file_name, std::string contents_in)
         : file_name(file_name),
           contents(),
           contents_size(contents_in.size()),
@@ -76,7 +76,7 @@ struct source
         auto str = std::make_shared<std::string>(std::move(contents_in));
         contents = std::shared_ptr<const char>(str, str->data());
     }
-    source(std::string file_name, std::vector<char> contents_in)
+    Source(std::string file_name, std::vector<char> contents_in)
         : file_name(file_name),
           contents(),
           contents_size(contents_in.size()),
@@ -85,7 +85,7 @@ struct source
         auto str = std::make_shared<std::vector<char>>(std::move(contents_in));
         contents = std::shared_ptr<const char>(str, str->data());
     }
-    source(std::string file_name, std::vector<unsigned char> contents_in)
+    Source(std::string file_name, std::vector<unsigned char> contents_in)
         : file_name(file_name),
           contents(),
           contents_size(contents_in.size()),
@@ -99,37 +99,37 @@ struct source
     {
         return contents != nullptr;
     }
-    static source load_file(std::string file_name);
-    static source load_stdin();
-    struct line_and_index
+    static Source load_file(std::string file_name);
+    static Source load_stdin();
+    struct Line_and_index
     {
         std::size_t line;
         std::size_t index;
-        constexpr line_and_index() noexcept : line(), index()
+        constexpr Line_and_index() noexcept : line(), index()
         {
         }
-        constexpr line_and_index(std::size_t line, std::size_t index) noexcept : line(line),
+        constexpr Line_and_index(std::size_t line, std::size_t index) noexcept : line(line),
                                                                                  index(index)
         {
         }
     };
-    struct line_and_column
+    struct Line_and_column
     {
         std::size_t line;
         std::size_t column;
-        constexpr line_and_column() noexcept : line(), column()
+        constexpr Line_and_column() noexcept : line(), column()
         {
         }
-        constexpr line_and_column(std::size_t line, std::size_t column) noexcept : line(line),
+        constexpr Line_and_column(std::size_t line, std::size_t column) noexcept : line(line),
                                                                                    column(column)
         {
         }
         std::string append_to_string(std::string buffer) const
         {
-            buffer = ast::number_value::append_unsigned_integer_to_string(line, std::move(buffer));
+            buffer = ast::Number_value::append_unsigned_integer_to_string(line, std::move(buffer));
             buffer += ':';
             buffer =
-                ast::number_value::append_unsigned_integer_to_string(column, std::move(buffer));
+                ast::Number_value::append_unsigned_integer_to_string(column, std::move(buffer));
             return buffer;
         }
         std::string to_string(std::string buffer = {}) const
@@ -137,47 +137,47 @@ struct source
             buffer.clear();
             return append_to_string(std::move(buffer));
         }
-        friend std::ostream &operator<<(std::ostream &os, const line_and_column &v);
+        friend std::ostream &operator<<(std::ostream &os, const Line_and_column &v);
     };
     static constexpr std::size_t default_tab_size = 8;
-    line_and_index get_line_and_start_index(std::size_t char_index) const noexcept;
-    line_and_column get_line_and_column(std::size_t char_index,
+    Line_and_index get_line_and_start_index(std::size_t char_index) const noexcept;
+    Line_and_column get_line_and_column(std::size_t char_index,
                                         std::size_t tab_size = default_tab_size) const noexcept;
 };
 
-struct location
+struct Location
 {
-    const source *source;
+    const Source *source;
     std::size_t char_index;
-    constexpr location() noexcept : source(nullptr), char_index(0)
+    constexpr Location() noexcept : source(nullptr), char_index(0)
     {
     }
-    constexpr location(const json::source *source, std::size_t char_index) noexcept
+    constexpr Location(const json::Source *source, std::size_t char_index) noexcept
         : source(source),
           char_index(char_index)
     {
     }
-    json::source::line_and_index get_line_and_start_index() const noexcept
+    json::Source::Line_and_index get_line_and_start_index() const noexcept
     {
         if(!source)
             return {};
         return source->get_line_and_start_index(char_index);
     }
-    json::source::line_and_column get_line_and_column(
-        std::size_t tab_size = json::source::default_tab_size) const noexcept
+    json::Source::Line_and_column get_line_and_column(
+        std::size_t tab_size = json::Source::default_tab_size) const noexcept
     {
         if(!source)
             return {};
         return source->get_line_and_column(char_index, tab_size);
     }
     std::string to_string(std::string buffer = {},
-                          std::size_t tab_size = json::source::default_tab_size) const
+                          std::size_t tab_size = json::Source::default_tab_size) const
     {
         buffer.clear();
         return append_to_string(std::move(buffer));
     }
     std::string append_to_string(std::string buffer,
-                                 std::size_t tab_size = json::source::default_tab_size) const
+                                 std::size_t tab_size = json::Source::default_tab_size) const
     {
         if(!source || source->file_name.empty())
             buffer += "<unknown>";
@@ -187,36 +187,36 @@ struct location
         buffer = get_line_and_column(tab_size).append_to_string(std::move(buffer));
         return buffer;
     }
-    friend std::ostream &operator<<(std::ostream &os, const location &v);
+    friend std::ostream &operator<<(std::ostream &os, const Location &v);
 };
 
-class parse_error : public std::runtime_error
+class Parse_error : public std::runtime_error
 {
 public:
-    location location;
-    parse_error(json::location location, const std::string &message)
+    Location location;
+    Parse_error(json::Location location, const std::string &message)
         : runtime_error(location.to_string() + ": " + message)
     {
     }
-    parse_error(json::location location, const char *message)
+    Parse_error(json::Location location, const char *message)
         : runtime_error(location.to_string() + ": " + message)
     {
     }
 };
 
-struct parse_options
+struct Parse_options
 {
     bool allow_infinity_and_nan;
     bool allow_explicit_plus_sign_in_mantissa;
     bool allow_single_quote_strings;
     bool allow_number_to_start_with_dot;
-    constexpr parse_options() noexcept : allow_infinity_and_nan(false),
+    constexpr Parse_options() noexcept : allow_infinity_and_nan(false),
                                          allow_explicit_plus_sign_in_mantissa(false),
                                          allow_single_quote_strings(false),
                                          allow_number_to_start_with_dot(false)
     {
     }
-    constexpr parse_options(bool allow_infinity_and_nan,
+    constexpr Parse_options(bool allow_infinity_and_nan,
                             bool allow_explicit_plus_sign_in_mantissa,
                             bool allow_single_quote_strings,
                             bool allow_number_to_start_with_dot) noexcept
@@ -226,17 +226,17 @@ struct parse_options
           allow_number_to_start_with_dot(allow_number_to_start_with_dot)
     {
     }
-    static constexpr parse_options default_options() noexcept
+    static constexpr Parse_options default_options() noexcept
     {
-        return parse_options();
+        return Parse_options();
     }
-    static constexpr parse_options relaxed_options() noexcept
+    static constexpr Parse_options relaxed_options() noexcept
     {
-        return parse_options(true, true, true, true);
+        return Parse_options(true, true, true, true);
     }
 };
 
-ast::value parse(const source *source, parse_options options = parse_options::default_options());
+ast::Value parse(const Source *source, Parse_options options = Parse_options::default_options());
 }
 }
 
index 5e564c25f9cf16d144b41e465b279d721aed51f5..e9cac8915765393b6c23f5247f7e8802befbc067 100644 (file)
@@ -30,8 +30,8 @@ namespace vulkan_cpu
 {
 namespace spirv
 {
-typedef std::uint32_t word;
-constexpr word magic_number = 0x07230203UL;
+typedef std::uint32_t Word;
+constexpr Word magic_number = 0x07230203UL;
 }
 }
 
index 96800400d8f421b5ec1db2bd982b254a1b45f363..1a2b801fa0b256c142112d30ce770d54b84a700f 100644 (file)
@@ -60,13 +60,13 @@ constexpr decltype(auto) invoke_member_function_pointer(
 }
 
 template <typename T>
-struct invoke_is_reference_wrapper
+struct Invoke_is_reference_wrapper
 {
     static constexpr bool value = false;
 };
 
 template <typename T>
-struct invoke_is_reference_wrapper<std::reference_wrapper<T>>
+struct Invoke_is_reference_wrapper<std::reference_wrapper<T>>
 {
     static constexpr bool value = true;
 };
@@ -78,7 +78,7 @@ template <
     typename... Args,
     typename = int,
     typename = typename std::enable_if<!std::is_base_of<T, typename std::decay<Arg1>::type>::value
-                                       && invoke_is_reference_wrapper<
+                                       && Invoke_is_reference_wrapper<
                                               typename std::decay<Arg1>::type>::value>::type>
 constexpr decltype(auto) invoke_member_function_pointer(
     Fn T::*fn,
@@ -96,7 +96,7 @@ template <
     typename = int,
     typename = int,
     typename = typename std::enable_if<!std::is_base_of<T, typename std::decay<Arg1>::type>::value
-                                       && !invoke_is_reference_wrapper<
+                                       && !Invoke_is_reference_wrapper<
                                               typename std::decay<Arg1>::type>::value>::type>
 constexpr decltype(auto) invoke_member_function_pointer(
     Fn T::*fn, Arg1 &&arg1, Args &&... args) noexcept(noexcept(((*std::forward<Arg1>(arg1))
@@ -133,7 +133,7 @@ template <
     typename Arg,
     typename = int,
     typename = typename std::enable_if<!std::is_base_of<T, typename std::decay<Arg>::type>::value
-                                       && invoke_is_reference_wrapper<
+                                       && Invoke_is_reference_wrapper<
                                               typename std::decay<Arg>::type>::value>::type>
 constexpr decltype(auto) invoke_member_object_pointer(Fn T::*fn,
                                                       Arg &&arg) noexcept(noexcept(arg.get().*fn))
@@ -148,7 +148,7 @@ template <
     typename = int,
     typename = int,
     typename = typename std::enable_if<!std::is_base_of<T, typename std::decay<Arg>::type>::value
-                                       && !invoke_is_reference_wrapper<
+                                       && !Invoke_is_reference_wrapper<
                                               typename std::decay<Arg>::type>::value>::type>
 constexpr decltype(auto) invoke_member_object_pointer(Fn T::*fn, Arg &&arg) noexcept(
     noexcept((*std::forward<Arg>(arg)).*fn))
@@ -166,7 +166,7 @@ constexpr decltype(auto) invoke_helper(Fn fn, Arg &&arg) noexcept(
 }
 
 template <typename Fn, typename = void, typename... Args>
-struct invoke_result_helper
+struct Invoke_result_helper
 {
     static constexpr bool is_invokable = false;
     static constexpr bool is_nothrow_invokable = false;
@@ -183,7 +183,7 @@ struct invoke_result_helper
 };
 
 template <typename Fn, typename... Args>
-struct invoke_result_helper<Fn,
+struct Invoke_result_helper<Fn,
                             void_t<decltype(
                                 invoke_helper(std::declval<Fn>(), std::declval<Args>()...))>,
                             Args...>
@@ -218,7 +218,7 @@ struct invoke_result_helper<Fn,
 }
 
 template <typename Fn, typename... Args>
-struct invoke_result : public detail::invoke_result_helper<Fn, void, Args...>
+struct invoke_result : public detail::Invoke_result_helper<Fn, void, Args...>
 {
 };
 
@@ -234,7 +234,7 @@ constexpr invoke_result_t<Fn, Args...> invoke(Fn &&fn, Args &&... args) noexcept
 
 template <typename Fn, typename... Args>
 struct is_invocable
-    : public std::integral_constant<bool, detail::invoke_result_helper<Fn, Args...>::is_invokable>
+    : public std::integral_constant<bool, detail::Invoke_result_helper<Fn, Args...>::is_invokable>
 {
 };
 
@@ -243,8 +243,9 @@ constexpr bool is_invocable_v = is_invocable<Fn, Args...>::value;
 
 template <typename R, typename Fn, typename... Args>
 struct is_invocable_r
-    : public std::integral_constant<bool,
-                                    detail::invoke_result_helper<Fn, Args...>::template is_invokable_r<R>()>
+    : public std::
+          integral_constant<bool,
+                            detail::Invoke_result_helper<Fn, Args...>::template is_invokable_r<R>()>
 {
 };
 
@@ -254,7 +255,7 @@ constexpr bool is_invocable_r_v = is_invocable_r<R, Fn, Args...>::value;
 template <typename Fn, typename... Args>
 struct is_nothrow_invocable
     : public std::integral_constant<bool,
-                                    detail::invoke_result_helper<Fn, Args...>::is_nothrow_invokable>
+                                    detail::Invoke_result_helper<Fn, Args...>::is_nothrow_invokable>
 {
 };
 
@@ -263,9 +264,9 @@ constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<Fn, Args...>::value
 
 template <typename R, typename Fn, typename... Args>
 struct is_nothrow_invocable_r
-    : public std::
-          integral_constant<bool,
-                            detail::invoke_result_helper<Fn, Args...>::template is_nothrow_invokable_r<R>()>
+    : public std::integral_constant<bool,
+                                    detail::Invoke_result_helper<Fn, Args...>::
+                                        template is_nothrow_invokable_r<R>()>
 {
 };
 
index 483fb33c8913ef1b7b95ac3ff8693381c8e486c5..a6cb63136ab67b44d73ab6448586580b6858a2c5 100644 (file)
@@ -32,7 +32,7 @@ namespace vulkan_cpu_util_is_swappable_unrelated_namespace
 {
 using std::swap;
 template <typename T, typename U, bool Is_Void = std::is_void<T>::value || std::is_void<T>::value>
-class is_swappable_with
+class Is_swappable_with
 {
 private:
     template <typename L,
@@ -48,21 +48,21 @@ public:
 };
 
 template <typename T, typename U>
-class is_swappable_with<T, U, true>
+class Is_swappable_with<T, U, true>
 {
 public:
     static constexpr bool value = false;
 };
 
-template <typename T, typename U, bool Is_Swappable_With = is_swappable_with<T, U>::value>
-struct is_nothrow_swappable_with
+template <typename T, typename U, bool Is_Swappable_With = Is_swappable_with<T, U>::value>
+struct Is_nothrow_swappable_with
 {
     static constexpr bool value = noexcept(swap(std::declval<T>(), std::declval<U>()))
                                   && noexcept(swap(std::declval<U>(), std::declval<T>()));
 };
 
 template <typename T, typename U>
-struct is_nothrow_swappable_with<T, U, false>
+struct Is_nothrow_swappable_with<T, U, false>
 {
     static constexpr bool value = false;
 };
@@ -76,7 +76,7 @@ template <typename T, typename U>
 struct is_swappable_with
     : public std::integral_constant<bool,
                                     vulkan_cpu_util_is_swappable_unrelated_namespace::
-                                        is_swappable_with<T, U>::value>
+                                        Is_swappable_with<T, U>::value>
 {
 };
 
@@ -87,7 +87,7 @@ template <typename T, typename U>
 struct is_nothrow_swappable_with
     : public std::integral_constant<bool,
                                     vulkan_cpu_util_is_swappable_unrelated_namespace::
-                                        is_nothrow_swappable_with<T, U>::value>
+                                        Is_nothrow_swappable_with<T, U>::value>
 {
 };
 
index 25f0e40afbf4ea8d144c90cb4725276971a7e44e..714470746ce0e5ffce70c96e2208b49115924e37 100644 (file)
@@ -62,7 +62,7 @@ namespace detail
 template <typename T,
           bool Is_Trivially_Destructible = std::is_trivially_destructible<T>::value,
           bool Is_Trivially_Copyable = std::is_trivially_copyable<T>::value>
-struct optional_base
+struct Optional_base
 {
     union
     {
@@ -70,10 +70,10 @@ struct optional_base
         alignas(T) char empty_value[sizeof(T)];
     };
     bool is_full;
-    constexpr optional_base() noexcept : empty_value{}, is_full(false)
+    constexpr Optional_base() noexcept : empty_value{}, is_full(false)
     {
     }
-    constexpr optional_base(nullopt_t) noexcept : empty_value{}, is_full(false)
+    constexpr Optional_base(nullopt_t) noexcept : empty_value{}, is_full(false)
     {
     }
     void reset() noexcept
@@ -103,13 +103,13 @@ struct optional_base
         is_full = true;
         return full_value;
     }
-    optional_base(const optional_base &rt) noexcept(std::is_nothrow_copy_constructible<T>::value)
+    Optional_base(const Optional_base &rt) noexcept(std::is_nothrow_copy_constructible<T>::value)
         : empty_value{}, is_full(false)
     {
         if(rt.is_full)
             emplace(rt.full_value);
     }
-    optional_base(optional_base &&rt) noexcept(std::is_nothrow_move_constructible<T>::value)
+    Optional_base(Optional_base &&rt) noexcept(std::is_nothrow_move_constructible<T>::value)
         : empty_value{}, is_full(false)
     {
         if(rt.is_full)
@@ -117,7 +117,7 @@ struct optional_base
     }
     template <typename... Types,
               typename = typename std::enable_if<std::is_constructible<T, Types...>::value>::type>
-    constexpr explicit optional_base(in_place_t, Types &&... args) noexcept(
+    constexpr explicit Optional_base(in_place_t, Types &&... args) noexcept(
         std::is_nothrow_constructible<T, Types...>::value)
         : full_value(std::forward<Types>(args)...), is_full(true)
     {
@@ -127,18 +127,18 @@ struct optional_base
         typename... Types,
         typename = typename std::
             enable_if<std::is_constructible<T, std::initializer_list<U>, Types...>::value>::type>
-    constexpr explicit optional_base(
+    constexpr explicit Optional_base(
         in_place_t,
         std::initializer_list<U> init_list,
         Types &&... args) noexcept(std::is_nothrow_constructible<T, Types...>::value)
         : full_value(init_list, std::forward<Types>(args)...), is_full(true)
     {
     }
-    ~optional_base()
+    ~Optional_base()
     {
         reset();
     }
-    optional_base &operator=(const optional_base &rt) noexcept(
+    Optional_base &operator=(const Optional_base &rt) noexcept(
         std::is_nothrow_copy_assignable<T>::value)
     {
         if(!rt.is_full)
@@ -149,7 +149,7 @@ struct optional_base
             full_value = rt.full_value;
         return *this;
     }
-    optional_base &operator=(optional_base &&rt) noexcept(std::is_nothrow_move_assignable<T>::value)
+    Optional_base &operator=(Optional_base &&rt) noexcept(std::is_nothrow_move_assignable<T>::value)
     {
         if(!rt.is_full)
             reset();
@@ -162,7 +162,7 @@ struct optional_base
 };
 
 template <typename T>
-struct optional_base<T, true, false>
+struct Optional_base<T, true, false>
 {
     union
     {
@@ -170,10 +170,10 @@ struct optional_base<T, true, false>
         alignas(T) char empty_value[sizeof(T)];
     };
     bool is_full;
-    constexpr optional_base() noexcept : empty_value{}, is_full(false)
+    constexpr Optional_base() noexcept : empty_value{}, is_full(false)
     {
     }
-    constexpr optional_base(nullopt_t) noexcept : empty_value{}, is_full(false)
+    constexpr Optional_base(nullopt_t) noexcept : empty_value{}, is_full(false)
     {
     }
     void reset() noexcept
@@ -202,13 +202,13 @@ struct optional_base<T, true, false>
         is_full = true;
         return full_value;
     }
-    optional_base(const optional_base &rt) noexcept(std::is_nothrow_copy_constructible<T>::value)
+    Optional_base(const Optional_base &rt) noexcept(std::is_nothrow_copy_constructible<T>::value)
         : empty_value{}, is_full(false)
     {
         if(rt.is_full)
             emplace(rt.full_value);
     }
-    optional_base(optional_base &&rt) noexcept(std::is_nothrow_move_constructible<T>::value)
+    Optional_base(Optional_base &&rt) noexcept(std::is_nothrow_move_constructible<T>::value)
         : empty_value{}, is_full(false)
     {
         if(rt.is_full)
@@ -216,7 +216,7 @@ struct optional_base<T, true, false>
     }
     template <typename... Types,
               typename = typename std::enable_if<std::is_constructible<T, Types...>::value>::type>
-    constexpr explicit optional_base(in_place_t, Types &&... args) noexcept(
+    constexpr explicit Optional_base(in_place_t, Types &&... args) noexcept(
         std::is_nothrow_constructible<T, Types...>::value)
         : full_value(std::forward<Types>(args)...), is_full(true)
     {
@@ -226,15 +226,15 @@ struct optional_base<T, true, false>
         typename... Types,
         typename = typename std::
             enable_if<std::is_constructible<T, std::initializer_list<U>, Types...>::value>::type>
-    constexpr explicit optional_base(
+    constexpr explicit Optional_base(
         in_place_t,
         std::initializer_list<U> init_list,
         Types &&... args) noexcept(std::is_nothrow_constructible<T, Types...>::value)
         : full_value(init_list, std::forward<Types>(args)...), is_full(true)
     {
     }
-    ~optional_base() = default;
-    optional_base &operator=(const optional_base &rt) noexcept(
+    ~Optional_base() = default;
+    Optional_base &operator=(const Optional_base &rt) noexcept(
         std::is_nothrow_copy_assignable<T>::value)
     {
         if(!rt.is_full)
@@ -245,7 +245,7 @@ struct optional_base<T, true, false>
             full_value = rt.full_value;
         return *this;
     }
-    optional_base &operator=(optional_base &&rt) noexcept(std::is_nothrow_move_assignable<T>::value)
+    Optional_base &operator=(Optional_base &&rt) noexcept(std::is_nothrow_move_assignable<T>::value)
     {
         if(!rt.is_full)
             reset();
@@ -258,7 +258,7 @@ struct optional_base<T, true, false>
 };
 
 template <typename T>
-struct optional_base<T, true, true>
+struct Optional_base<T, true, true>
 {
     union
     {
@@ -266,10 +266,10 @@ struct optional_base<T, true, true>
         alignas(T) char empty_value[sizeof(T)];
     };
     bool is_full;
-    constexpr optional_base() noexcept : empty_value{}, is_full(false)
+    constexpr Optional_base() noexcept : empty_value{}, is_full(false)
     {
     }
-    constexpr optional_base(nullopt_t) noexcept : empty_value{}, is_full(false)
+    constexpr Optional_base(nullopt_t) noexcept : empty_value{}, is_full(false)
     {
     }
     void reset() noexcept
@@ -298,11 +298,11 @@ struct optional_base<T, true, true>
         is_full = true;
         return full_value;
     }
-    constexpr optional_base(const optional_base &rt) noexcept = default;
-    constexpr optional_base(optional_base &&rt) noexcept = default;
+    constexpr Optional_base(const Optional_base &rt) noexcept = default;
+    constexpr Optional_base(Optional_base &&rt) noexcept = default;
     template <typename... Types,
               typename = typename std::enable_if<std::is_constructible<T, Types...>::value>::type>
-    constexpr explicit optional_base(in_place_t, Types &&... args) noexcept(
+    constexpr explicit Optional_base(in_place_t, Types &&... args) noexcept(
         std::is_nothrow_constructible<T, Types...>::value)
         : full_value(std::forward<Types>(args)...), is_full(true)
     {
@@ -312,16 +312,16 @@ struct optional_base<T, true, true>
         typename... Types,
         typename = typename std::
             enable_if<std::is_constructible<T, std::initializer_list<U>, Types...>::value>::type>
-    constexpr explicit optional_base(
+    constexpr explicit Optional_base(
         in_place_t,
         std::initializer_list<U> init_list,
         Types &&... args) noexcept(std::is_nothrow_constructible<T, Types...>::value)
         : full_value(init_list, std::forward<Types>(args)...), is_full(true)
     {
     }
-    ~optional_base() = default;
-    optional_base &operator=(const optional_base &rt) noexcept = default;
-    optional_base &operator=(optional_base &&rt) noexcept = default;
+    ~Optional_base() = default;
+    Optional_base &operator=(const Optional_base &rt) noexcept = default;
+    Optional_base &operator=(Optional_base &&rt) noexcept = default;
 };
 }
 
@@ -390,25 +390,25 @@ constexpr bool optional_needs_conversion_from_optional_assign_operators() noexce
 }
 
 template <typename T>
-class optional : private detail::optional_base<T>
+class optional : private detail::Optional_base<T>
 {
 private:
-    typedef detail::optional_base<T> base;
-    using base::is_full;
-    using base::full_value;
+    typedef detail::Optional_base<T> Base;
+    using Base::is_full;
+    using Base::full_value;
 
 public:
-    using base::base;
-    using base::operator=;
-    using base::reset;
-    using base::emplace;
+    using Base::Base;
+    using Base::operator=;
+    using Base::reset;
+    using Base::emplace;
     constexpr optional() noexcept = default;
     template <typename U,
               typename = typename std::
                   enable_if<detail::optional_needs_conversion_constructors<T, U, const U &>()
                             && std::is_convertible<const U &, T>::value>::type>
     optional(const optional<U> &rt) noexcept(std::is_nothrow_constructible<T, const U &>::value)
-        : base()
+        : Base()
     {
         if(rt)
             emplace(*rt);
@@ -420,7 +420,7 @@ public:
               typename = void>
     explicit optional(const optional<U> &rt) noexcept(
         std::is_nothrow_constructible<T, const U &>::value)
-        : base()
+        : Base()
     {
         if(rt)
             emplace(*rt);
@@ -431,7 +431,7 @@ public:
             typename std::enable_if<detail::optional_needs_conversion_constructors<T, U, U &&>()
                                     && std::is_convertible<U &&, T>::value>::type>
     optional(optional<U> &&rt) noexcept(std::is_nothrow_constructible<T, U &&>::value)
-        : base()
+        : Base()
     {
         if(rt)
             emplace(std::move(*rt));
@@ -443,7 +443,7 @@ public:
                                     && !std::is_convertible<U &&, T>::value>::type,
         typename = void>
     explicit optional(optional<U> &&rt) noexcept(std::is_nothrow_constructible<T, U &&>::value)
-        : base()
+        : Base()
     {
         if(rt)
             emplace(std::move(*rt));
@@ -456,7 +456,7 @@ public:
                             && std::is_convertible<U &&, T>::value>::type,
               typename = void>
     constexpr optional(U &&value) noexcept(std::is_nothrow_constructible<T, U &&>::value)
-        : base(in_place, std::forward<U>(value))
+        : Base(in_place, std::forward<U>(value))
     {
     }
     template <typename U,
@@ -466,7 +466,7 @@ public:
                             && !std::is_same<typename std::decay<U>::type, optional>::value
                             && !std::is_convertible<U &&, T>::value>::type>
     explicit constexpr optional(U &&value) noexcept(std::is_nothrow_constructible<T, U &&>::value)
-        : base(in_place, std::forward<U>(value))
+        : Base(in_place, std::forward<U>(value))
     {
     }
     template <typename U = T,
index f7e6260f10bebe87ce93b363b1ebaeba0fcefa9c..da5ae14eb4232dc736cc04194c1614f48db55768 100644 (file)
@@ -154,36 +154,36 @@ using variant_alternative_t = typename variant_alternative<Index, T>::type;
 
 namespace detail
 {
-struct variant_base_construct_tag
+struct Variant_base_construct_tag
 {
-    explicit variant_base_construct_tag() = default;
+    explicit Variant_base_construct_tag() = default;
 };
 
 template <typename T>
-struct variant_identity_type
+struct Variant_identity_type
 {
     typedef T type;
 };
 
 template <typename... Types>
-struct variant_hypothetical_overload_set;
+struct Variant_hypothetical_overload_set;
 
 template <typename T, typename... Types>
-struct variant_hypothetical_overload_set<T, Types...>
-    : public variant_hypothetical_overload_set<Types...>
+struct Variant_hypothetical_overload_set<T, Types...>
+    : public Variant_hypothetical_overload_set<Types...>
 {
-    using variant_hypothetical_overload_set<Types...>::fn;
-    static variant_identity_type<T> fn(T); // not implemented
+    using Variant_hypothetical_overload_set<Types...>::fn;
+    static Variant_identity_type<T> fn(T); // not implemented
 };
 
 template <>
-struct variant_hypothetical_overload_set<>
+struct Variant_hypothetical_overload_set<>
 {
     static void fn(); // not implemented
 };
 
 template <typename T>
-struct variant_is_equals_comparable
+struct Variant_is_equals_comparable
 {
 private:
     static std::false_type fn(...);
@@ -197,7 +197,7 @@ public:
 };
 
 template <typename T>
-struct variant_is_less_comparable
+struct Variant_is_less_comparable
 {
 private:
     static std::false_type fn(...);
@@ -211,7 +211,7 @@ public:
 };
 
 template <typename T>
-struct variant_is_nothrow_equals_comparable
+struct Variant_is_nothrow_equals_comparable
 {
 private:
     static std::false_type fn(...);
@@ -226,7 +226,7 @@ public:
 };
 
 template <typename T>
-struct variant_is_nothrow_less_comparable
+struct Variant_is_nothrow_less_comparable
 {
 private:
     static std::false_type fn(...);
@@ -253,7 +253,7 @@ constexpr bool variant_is_trivially_destructible() noexcept
 }
 
 template <bool Is_Trivially_Destructible, typename... Types>
-union variant_values_implementation
+union Variant_values_implementation
 {
     char value;
     static constexpr bool is_copy_constructible = true;
@@ -270,9 +270,9 @@ union variant_values_implementation
     static constexpr bool is_less_comparable = true;
     static constexpr bool is_nothrow_equals_comparable = true;
     static constexpr bool is_nothrow_less_comparable = true;
-    variant_values_implementation() = delete;
+    Variant_values_implementation() = delete;
     template <std::size_t index>
-    constexpr variant_values_implementation(in_place_index_t<index>) noexcept : value()
+    constexpr Variant_values_implementation(in_place_index_t<index>) noexcept : value()
     {
     }
     template <typename U>
@@ -280,43 +280,43 @@ union variant_values_implementation
     {
         return variant_npos;
     }
-    void copy_construct(const variant_values_implementation &rt, std::size_t index) noexcept
+    void copy_construct(const Variant_values_implementation &rt, std::size_t index) noexcept
     {
     }
-    void move_construct(variant_values_implementation &&rt, std::size_t index) noexcept
+    void move_construct(Variant_values_implementation &&rt, std::size_t index) noexcept
     {
     }
-    void copy_assign(const variant_values_implementation &rt, std::size_t index) noexcept
+    void copy_assign(const Variant_values_implementation &rt, std::size_t index) noexcept
     {
     }
-    void move_assign(variant_values_implementation &&rt, std::size_t index) noexcept
+    void move_assign(Variant_values_implementation &&rt, std::size_t index) noexcept
     {
     }
     void destruct(std::size_t index) noexcept
     {
     }
-    void swap(variant_values_implementation &rt, std::size_t index) noexcept
+    void swap(Variant_values_implementation &rt, std::size_t index) noexcept
     {
     }
-    bool is_equal(const variant_values_implementation &rt, std::size_t index) const noexcept
+    bool is_equal(const Variant_values_implementation &rt, std::size_t index) const noexcept
     {
         return true;
     }
-    bool is_less(const variant_values_implementation &rt, std::size_t index) const noexcept
+    bool is_less(const Variant_values_implementation &rt, std::size_t index) const noexcept
     {
         return false;
     }
 };
 
 template <typename... Types>
-using variant_values =
-    variant_values_implementation<variant_is_trivially_destructible<Types...>(), Types...>;
+using Variant_values =
+    Variant_values_implementation<variant_is_trivially_destructible<Types...>(), Types...>;
 
 #define VULKAN_CPU_UTIL_VARIANT_VALUES(Is_Trivially_Destructible, Destructor)                                    \
     template <typename T, typename... Types>                                                                     \
-    union variant_values_implementation<Is_Trivially_Destructible, T, Types...>                                  \
+    union Variant_values_implementation<Is_Trivially_Destructible, T, Types...>                                  \
     {                                                                                                            \
-        typedef T type_0;                                                                                        \
+        typedef T Type_0;                                                                                        \
         static_assert(!std::is_void<T>::value, "invalid variant member type");                                   \
         static_assert(!std::is_reference<T>::value, "invalid variant member type");                              \
         static_assert(!std::is_array<T>::value, "invalid variant member type");                                  \
@@ -324,68 +324,68 @@ using variant_values =
         static_assert(!std::is_volatile<T>::value, "invalid variant member type");                               \
         static_assert(std::is_object<T>::value, "invalid variant member type");                                  \
         T current_value;                                                                                         \
-        variant_values_implementation<Is_Trivially_Destructible, Types...> other_values;                         \
+        Variant_values_implementation<Is_Trivially_Destructible, Types...> other_values;                         \
         static constexpr bool is_copy_constructible =                                                            \
             std::is_copy_constructible<T>::value                                                                 \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_copy_constructible;                                   \
         static constexpr bool is_move_constructible =                                                            \
             std::is_move_constructible<T>::value                                                                 \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_move_constructible;                                   \
         static constexpr bool is_nothrow_copy_constructible =                                                    \
             std::is_nothrow_copy_constructible<T>::value                                                         \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_nothrow_copy_constructible;                           \
         static constexpr bool is_nothrow_move_constructible =                                                    \
             std::is_nothrow_move_constructible<T>::value                                                         \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_nothrow_move_constructible;                           \
         static constexpr bool is_copy_assignable =                                                               \
             std::is_copy_assignable<T>::value && std::is_copy_constructible<T>::value                            \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_copy_assignable;                                      \
         static constexpr bool is_move_assignable =                                                               \
             std::is_move_assignable<T>::value && std::is_move_constructible<T>::value                            \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_move_assignable;                                      \
         static constexpr bool is_nothrow_copy_assignable =                                                       \
             std::is_nothrow_copy_assignable<T>::value                                                            \
             && std::is_nothrow_copy_constructible<T>::value                                                      \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_nothrow_copy_assignable;                              \
         static constexpr bool is_nothrow_move_assignable =                                                       \
             std::is_nothrow_move_assignable<T>::value                                                            \
             && std::is_nothrow_move_constructible<T>::value                                                      \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_nothrow_move_assignable;                              \
         static constexpr bool is_swappable =                                                                     \
             is_swappable_v<T> && std::is_move_constructible<T>::value                                            \
-            && variant_values_implementation<Is_Trivially_Destructible, Types...>::is_swappable;                 \
+            && Variant_values_implementation<Is_Trivially_Destructible, Types...>::is_swappable;                 \
         static constexpr bool is_nothrow_swappable =                                                             \
             is_nothrow_swappable_v<T> && std::is_nothrow_move_constructible<T>::value                            \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_nothrow_swappable;                                    \
         static constexpr bool is_equals_comparable =                                                             \
-            variant_is_equals_comparable<T>::value                                                               \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            Variant_is_equals_comparable<T>::value                                                               \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_equals_comparable;                                    \
         static constexpr bool is_less_comparable =                                                               \
-            variant_is_less_comparable<T>::value                                                                 \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            Variant_is_less_comparable<T>::value                                                                 \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_less_comparable;                                      \
         static constexpr bool is_nothrow_equals_comparable =                                                     \
-            variant_is_nothrow_equals_comparable<T>::value                                                       \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            Variant_is_nothrow_equals_comparable<T>::value                                                       \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_nothrow_equals_comparable;                            \
         static constexpr bool is_nothrow_less_comparable =                                                       \
-            variant_is_nothrow_less_comparable<T>::value                                                         \
-            && variant_values_implementation<Is_Trivially_Destructible,                                          \
+            Variant_is_nothrow_less_comparable<T>::value                                                         \
+            && Variant_values_implementation<Is_Trivially_Destructible,                                          \
                                              Types...>::is_nothrow_less_comparable;                              \
         template <                                                                                               \
             typename T2 = T,                                                                                     \
             typename = typename std::enable_if<std::is_default_constructible<T2>::value>::type>                  \
-        constexpr variant_values_implementation() noexcept(                                                      \
+        constexpr Variant_values_implementation() noexcept(                                                      \
             std::is_nothrow_default_constructible<T2>::value)                                                    \
             : current_value()                                                                                    \
         {                                                                                                        \
@@ -393,7 +393,7 @@ using variant_values =
         template <                                                                                               \
             typename... Args,                                                                                    \
             typename = typename std::enable_if<std::is_constructible<T, Args...>::value>::type>                  \
-        constexpr variant_values_implementation(in_place_index_t<0>, Args &&... args) noexcept(                  \
+        constexpr Variant_values_implementation(in_place_index_t<0>, Args &&... args) noexcept(                  \
             std::is_nothrow_constructible<T, Args...>::value)                                                    \
             : current_value(std::forward<Args>(args)...)                                                         \
         {                                                                                                        \
@@ -403,12 +403,12 @@ using variant_values =
                   typename = typename std::                                                                      \
                       enable_if<index != 0                                                                       \
                                 && std::                                                                         \
-                                       is_constructible<variant_values_implementation<Is_Trivially_Destructible, \
+                                       is_constructible<Variant_values_implementation<Is_Trivially_Destructible, \
                                                                                       Types...>,                 \
                                                         in_place_index_t<index - 1>,                             \
                                                         Args...>::value>::type>                                  \
-        constexpr variant_values_implementation(in_place_index_t<index>, Args &&... args) noexcept(              \
-            std::is_nothrow_constructible<variant_values_implementation<Is_Trivially_Destructible,               \
+        constexpr Variant_values_implementation(in_place_index_t<index>, Args &&... args) noexcept(              \
+            std::is_nothrow_constructible<Variant_values_implementation<Is_Trivially_Destructible,               \
                                                                         Types...>,                               \
                                           in_place_index_t<index - 1>,                                           \
                                           Args...>::value)                                                       \
@@ -421,7 +421,7 @@ using variant_values =
             typename = typename std::enable_if<std::is_constructible<T,                                          \
                                                                      std::initializer_list<U>,                   \
                                                                      Args...>::value>::type>                     \
-        constexpr variant_values_implementation(                                                                 \
+        constexpr Variant_values_implementation(                                                                 \
             in_place_index_t<0>,                                                                                 \
             std::initializer_list<U> il,                                                                         \
             Args &&... args) noexcept(std::is_nothrow_constructible<T,                                           \
@@ -434,7 +434,7 @@ using variant_values =
         static constexpr std::size_t index_from_type() noexcept                                                  \
         {                                                                                                        \
             std::size_t next =                                                                                   \
-                variant_values_implementation<Is_Trivially_Destructible,                                         \
+                Variant_values_implementation<Is_Trivially_Destructible,                                         \
                                               Types...>::template index_from_type<U>();                          \
             if(std::is_same<U, T>::value && next == variant_npos)                                                \
                 return 0;                                                                                        \
@@ -442,7 +442,7 @@ using variant_values =
                 return variant_npos;                                                                             \
             return next + 1;                                                                                     \
         }                                                                                                        \
-        void copy_construct(const variant_values_implementation &rt,                                             \
+        void copy_construct(const Variant_values_implementation &rt,                                             \
                             std::size_t index) noexcept(is_nothrow_copy_constructible)                           \
         {                                                                                                        \
             if(index == 0)                                                                                       \
@@ -451,7 +451,7 @@ using variant_values =
             else                                                                                                 \
                 other_values.copy_construct(rt.other_values, index - 1);                                         \
         }                                                                                                        \
-        void move_construct(variant_values_implementation &&rt,                                                  \
+        void move_construct(Variant_values_implementation &&rt,                                                  \
                             std::size_t index) noexcept(is_nothrow_move_constructible)                           \
         {                                                                                                        \
             if(index == 0)                                                                                       \
@@ -460,7 +460,7 @@ using variant_values =
             else                                                                                                 \
                 other_values.move_construct(std::move(rt.other_values), index - 1);                              \
         }                                                                                                        \
-        void copy_assign(const variant_values_implementation &rt,                                                \
+        void copy_assign(const Variant_values_implementation &rt,                                                \
                          std::size_t index) noexcept(is_nothrow_copy_assignable)                                 \
         {                                                                                                        \
             if(index == 0)                                                                                       \
@@ -468,7 +468,7 @@ using variant_values =
             else                                                                                                 \
                 other_values.copy_assign(rt.other_values, index - 1);                                            \
         }                                                                                                        \
-        void move_assign(variant_values_implementation &&rt,                                                     \
+        void move_assign(Variant_values_implementation &&rt,                                                     \
                          std::size_t index) noexcept(is_nothrow_move_assignable)                                 \
         {                                                                                                        \
             if(index == 0)                                                                                       \
@@ -483,7 +483,7 @@ using variant_values =
             else                                                                                                 \
                 other_values.destruct(index - 1);                                                                \
         }                                                                                                        \
-        void swap(variant_values_implementation &rt,                                                             \
+        void swap(Variant_values_implementation &rt,                                                             \
                   std::size_t index) noexcept(is_nothrow_swappable)                                              \
         {                                                                                                        \
             using std::swap;                                                                                     \
@@ -492,14 +492,14 @@ using variant_values =
             else                                                                                                 \
                 other_values.swap(rt.other_values, index - 1);                                                   \
         }                                                                                                        \
-        bool is_equal(const variant_values_implementation &rt, std::size_t index) const                          \
+        bool is_equal(const Variant_values_implementation &rt, std::size_t index) const                          \
             noexcept(is_nothrow_equals_comparable)                                                               \
         {                                                                                                        \
             if(index == 0)                                                                                       \
                 return static_cast<bool>(current_value == rt.current_value);                                     \
             return other_values.is_equal(rt.other_values, index - 1);                                            \
         }                                                                                                        \
-        bool is_less(const variant_values_implementation &rt, std::size_t index) const                           \
+        bool is_less(const Variant_values_implementation &rt, std::size_t index) const                           \
             noexcept(is_nothrow_less_comparable)                                                                 \
         {                                                                                                        \
             if(index == 0)                                                                                       \
@@ -509,54 +509,54 @@ using variant_values =
         Destructor                                                                                               \
     };
 
-VULKAN_CPU_UTIL_VARIANT_VALUES(true, ~variant_values_implementation() = default;)
-VULKAN_CPU_UTIL_VARIANT_VALUES(false, ~variant_values_implementation(){})
+VULKAN_CPU_UTIL_VARIANT_VALUES(true, ~Variant_values_implementation() = default;)
+VULKAN_CPU_UTIL_VARIANT_VALUES(false, ~Variant_values_implementation(){})
 #undef VULKAN_CPU_UTIL_VARIANT_VALUES
 
 template <std::size_t Index, typename... Types>
-struct variant_get;
+struct Variant_get;
 
 template <std::size_t Index, typename T, typename... Types>
-struct variant_get<Index, T, Types...>
+struct Variant_get<Index, T, Types...>
 {
-    static constexpr auto get(const variant_values<T, Types...> &values) noexcept
-        -> decltype(variant_get<Index - 1, Types...>::get(values.other_values))
+    static constexpr auto get(const Variant_values<T, Types...> &values) noexcept
+        -> decltype(Variant_get<Index - 1, Types...>::get(values.other_values))
     {
-        return variant_get<Index - 1, Types...>::get(values.other_values);
+        return Variant_get<Index - 1, Types...>::get(values.other_values);
     }
-    static constexpr auto get(variant_values<T, Types...> &values) noexcept
-        -> decltype(variant_get<Index - 1, Types...>::get(values.other_values))
+    static constexpr auto get(Variant_values<T, Types...> &values) noexcept
+        -> decltype(Variant_get<Index - 1, Types...>::get(values.other_values))
     {
-        return variant_get<Index - 1, Types...>::get(values.other_values);
+        return Variant_get<Index - 1, Types...>::get(values.other_values);
     }
-    static constexpr auto get(const variant_values<T, Types...> &&values) noexcept
-        -> decltype(variant_get<Index - 1, Types...>::get(std::move(values.other_values)))
+    static constexpr auto get(const Variant_values<T, Types...> &&values) noexcept
+        -> decltype(Variant_get<Index - 1, Types...>::get(std::move(values.other_values)))
     {
-        return variant_get<Index - 1, Types...>::get(std::move(values.other_values));
+        return Variant_get<Index - 1, Types...>::get(std::move(values.other_values));
     }
-    static constexpr auto get(variant_values<T, Types...> &&values) noexcept
-        -> decltype(variant_get<Index - 1, Types...>::get(std::move(values.other_values)))
+    static constexpr auto get(Variant_values<T, Types...> &&values) noexcept
+        -> decltype(Variant_get<Index - 1, Types...>::get(std::move(values.other_values)))
     {
-        return variant_get<Index - 1, Types...>::get(std::move(values.other_values));
+        return Variant_get<Index - 1, Types...>::get(std::move(values.other_values));
     }
 };
 
 template <typename T, typename... Types>
-struct variant_get<0, T, Types...>
+struct Variant_get<0, T, Types...>
 {
-    static constexpr const T &get(const variant_values<T, Types...> &values) noexcept
+    static constexpr const T &get(const Variant_values<T, Types...> &values) noexcept
     {
         return values.current_value;
     }
-    static constexpr T &get(variant_values<T, Types...> &values) noexcept
+    static constexpr T &get(Variant_values<T, Types...> &values) noexcept
     {
         return values.current_value;
     }
-    static constexpr const T &&get(const variant_values<T, Types...> &&values) noexcept
+    static constexpr const T &&get(const Variant_values<T, Types...> &&values) noexcept
     {
         return std::move(values.current_value);
     }
-    static constexpr T &&get(variant_values<T, Types...> &&values) noexcept
+    static constexpr T &&get(Variant_values<T, Types...> &&values) noexcept
     {
         return std::move(values.current_value);
     }
@@ -569,10 +569,10 @@ struct variant_get<0, T, Types...>
               typename... Types,                                                                   \
               typename... Args>                                                                    \
     constexpr Return_Type variant_dispatch_helper_dispatch_function(                               \
-        Fn &&fn, Const variant_values<Types...> Ref values, Args &&... args)                       \
+        Fn &&fn, Const Variant_values<Types...> Ref values, Args &&... args)                       \
     {                                                                                              \
-        return std::forward<Fn>(fn)(variant_get<Index, Types...>::get(                             \
-                                        std::forward<Const variant_values<Types...> Ref>(values)), \
+        return std::forward<Fn>(fn)(Variant_get<Index, Types...>::get(                             \
+                                        std::forward<Const Variant_values<Types...> Ref>(values)), \
                                     std::forward<Args>(args)...);                                  \
     }                                                                                              \
                                                                                                    \
@@ -583,37 +583,37 @@ struct variant_get<0, T, Types...>
               typename Return_Type = typename std::common_type<decltype(std::declval<Fn>()(        \
                   std::declval<Const Types Ref>(), std::declval<Args>()...))...>::type>            \
     constexpr Return_Type variant_dispatch_helper(Fn &&fn,                                         \
-                                                  Const variant_values<Types...> Ref values,       \
+                                                  Const Variant_values<Types...> Ref values,       \
                                                   std::size_t index,                               \
                                                   std::index_sequence<Indexes...>,                 \
                                                   Args &&... args)                                 \
     {                                                                                              \
-        typedef Return_Type (*Dispatch_Function)(                                                  \
-            Fn && fn, Const variant_values<Types...> Ref values, Args && ... args);                \
-        const Dispatch_Function dispatch_functions[sizeof...(Types)] = {                           \
-            static_cast<Dispatch_Function>(                                                        \
+        typedef Return_Type (*Dispatch_function)(                                                  \
+            Fn && fn, Const Variant_values<Types...> Ref values, Args && ... args);                \
+        const Dispatch_function dispatch_functions[sizeof...(Types)] = {                           \
+            static_cast<Dispatch_function>(                                                        \
                 &variant_dispatch_helper_dispatch_function<Indexes, Return_Type>)...,              \
         };                                                                                         \
         if(index < sizeof...(Types))                                                               \
             return dispatch_functions[index](                                                      \
                 std::forward<Fn>(fn),                                                              \
-                std::forward<Const variant_values<Types...> Ref>(values),                          \
+                std::forward<Const Variant_values<Types...> Ref>(values),                          \
                 std::forward<Args>(args)...);                                                      \
         throw bad_variant_access();                                                                \
     }                                                                                              \
                                                                                                    \
     template <typename Fn, typename... Args, typename... Types>                                    \
     constexpr auto variant_dispatch(                                                               \
-        Fn &&fn, Const variant_values<Types...> Ref values, std::size_t index, Args &&... args)    \
+        Fn &&fn, Const Variant_values<Types...> Ref values, std::size_t index, Args &&... args)    \
         ->decltype(                                                                                \
             variant_dispatch_helper(std::forward<Fn>(fn),                                          \
-                                    std::forward<Const variant_values<Types...> Ref>(values),      \
+                                    std::forward<Const Variant_values<Types...> Ref>(values),      \
                                     index,                                                         \
                                     std::index_sequence_for<Types...>{},                           \
                                     std::forward<Args>(args)...))                                  \
     {                                                                                              \
         return variant_dispatch_helper(std::forward<Fn>(fn),                                       \
-                                       std::forward<Const variant_values<Types...> Ref>(values),   \
+                                       std::forward<Const Variant_values<Types...> Ref>(values),   \
                                        index,                                                      \
                                        std::index_sequence_for<Types...>{},                        \
                                        std::forward<Args>(args)...);                               \
@@ -627,38 +627,38 @@ struct variant_get<0, T, Types...>
                   std::declval<Const Types Ref>(), std::declval<Args>()...))...>::type>            \
     constexpr Return_Type variant_dispatch_helper_nothrow(                                         \
         Fn &&fn,                                                                                   \
-        Const variant_values<Types...> Ref values,                                                 \
+        Const Variant_values<Types...> Ref values,                                                 \
         std::size_t index,                                                                         \
         std::index_sequence<Indexes...>,                                                           \
         Args &&... args)                                                                           \
     {                                                                                              \
-        typedef Return_Type (*Dispatch_Function)(                                                  \
-            Fn && fn, Const variant_values<Types...> Ref values, Args && ... args);                \
-        const Dispatch_Function dispatch_functions[sizeof...(Types)] = {                           \
-            static_cast<Dispatch_Function>(                                                        \
+        typedef Return_Type (*Dispatch_function)(                                                  \
+            Fn && fn, Const Variant_values<Types...> Ref values, Args && ... args);                \
+        const Dispatch_function dispatch_functions[sizeof...(Types)] = {                           \
+            static_cast<Dispatch_function>(                                                        \
                 &variant_dispatch_helper_dispatch_function<Indexes, Return_Type>)...,              \
         };                                                                                         \
         if(index < sizeof...(Types))                                                               \
             return dispatch_functions[index](                                                      \
                 std::forward<Fn>(fn),                                                              \
-                std::forward<Const variant_values<Types...> Ref>(values),                          \
+                std::forward<Const Variant_values<Types...> Ref>(values),                          \
                 std::forward<Args>(args)...);                                                      \
         return {};                                                                                 \
     }                                                                                              \
                                                                                                    \
     template <typename Fn, typename... Args, typename... Types>                                    \
     constexpr auto variant_dispatch_nothrow(                                                       \
-        Fn &&fn, Const variant_values<Types...> Ref values, std::size_t index, Args &&... args)    \
+        Fn &&fn, Const Variant_values<Types...> Ref values, std::size_t index, Args &&... args)    \
         ->decltype(variant_dispatch_helper_nothrow(                                                \
             std::forward<Fn>(fn),                                                                  \
-            std::forward<Const variant_values<Types...> Ref>(values),                              \
+            std::forward<Const Variant_values<Types...> Ref>(values),                              \
             index,                                                                                 \
             std::index_sequence_for<Types...>{},                                                   \
             std::forward<Args>(args)...))                                                          \
     {                                                                                              \
         return variant_dispatch_helper_nothrow(                                                    \
             std::forward<Fn>(fn),                                                                  \
-            std::forward<Const variant_values<Types...> Ref>(values),                              \
+            std::forward<Const Variant_values<Types...> Ref>(values),                              \
             index,                                                                                 \
             std::index_sequence_for<Types...>{},                                                   \
             std::forward<Args>(args)...);                                                          \
@@ -671,7 +671,7 @@ VULKAN_CPU_UTIL_VARIANT_DISPATCH(const, &&)
 #undef VULKAN_CPU_UTIL_VARIANT_DISPATCH
 
 template <std::size_t Type_Count>
-struct variant_index_type
+struct Variant_index_type
 {
     static constexpr std::size_t total_state_count =
         Type_Count + 1; // for valueless-by-exception state
@@ -687,22 +687,22 @@ struct variant_index_type
         total_state_count <= std::numeric_limits<unsigned long long>::max();
     typedef
         typename std::conditional<is_unsigned_long_long_good, unsigned long long, std::size_t>::type
-            unsigned_long_long_or_larger;
+            Unsigned_long_long_or_larger;
     typedef typename std::conditional<is_unsigned_long_good,
                                       unsigned long,
-                                      unsigned_long_long_or_larger>::type unsigned_long_or_larger;
-    typedef typename std::conditional<is_unsigned_good, unsigned, unsigned_long_or_larger>::type
-        unsigned_or_larger;
+                                      Unsigned_long_long_or_larger>::type Unsigned_long_or_larger;
+    typedef typename std::conditional<is_unsigned_good, unsigned, Unsigned_long_or_larger>::type
+        Unsigned_or_larger;
     typedef
-        typename std::conditional<is_unsigned_short_good, unsigned short, unsigned_or_larger>::type
-            unsigned_short_or_larger;
+        typename std::conditional<is_unsigned_short_good, unsigned short, Unsigned_or_larger>::type
+            Unsigned_short_or_larger;
     typedef typename std::conditional<is_unsigned_char_good,
                                       unsigned char,
-                                      unsigned_short_or_larger>::type type;
+                                      Unsigned_short_or_larger>::type type;
     static constexpr type npos = variant_npos;
     type index_value;
-    constexpr variant_index_type() = delete;
-    constexpr explicit variant_index_type(std::size_t index_value) noexcept
+    constexpr Variant_index_type() = delete;
+    constexpr explicit Variant_index_type(std::size_t index_value) noexcept
         : index_value(index_value)
     {
     }
@@ -722,19 +722,19 @@ template <bool Is_Trivially_Destructible,
           bool Is_Copy_Assignable,
           bool Is_Move_Assignable,
           typename... Types>
-struct variant_base;
+struct Variant_base;
 
 #define VULKAN_CPU_UTIL_VARIANT_BASE_DESTRUCTOR_false \
-    ~variant_base()                                   \
+    ~Variant_base()                                   \
     {                                                 \
         values.destruct(index_value.get());           \
     }
 
-#define VULKAN_CPU_UTIL_VARIANT_BASE_DESTRUCTOR_true ~variant_base() = default;
+#define VULKAN_CPU_UTIL_VARIANT_BASE_DESTRUCTOR_true ~Variant_base() = default;
 
 #define VULKAN_CPU_UTIL_VARIANT_BASE_COPY_CONSTRUCTOR_true                \
-    variant_base(const variant_base &rt) noexcept(                        \
-        detail::variant_values<Types...>::is_nothrow_copy_constructible)  \
+    Variant_base(const Variant_base &rt) noexcept(                        \
+        Variant_values<Types...>::is_nothrow_copy_constructible)          \
         : values(in_place_index<variant_npos>), index_value(variant_npos) \
     {                                                                     \
         values.copy_construct(rt.values, rt.index_value.get());           \
@@ -742,11 +742,11 @@ struct variant_base;
     }
 
 #define VULKAN_CPU_UTIL_VARIANT_BASE_COPY_CONSTRUCTOR_false \
-    variant_base(const variant_base &rt) = delete;
+    Variant_base(const Variant_base &rt) = delete;
 
 #define VULKAN_CPU_UTIL_VARIANT_BASE_MOVE_CONSTRUCTOR_true                 \
-    variant_base(variant_base &&rt) noexcept(                              \
-        detail::variant_values<Types...>::is_nothrow_move_constructible)   \
+    Variant_base(Variant_base &&rt) noexcept(                              \
+        Variant_values<Types...>::is_nothrow_move_constructible)           \
         : values(in_place_index<variant_npos>), index_value(variant_npos)  \
     {                                                                      \
         values.move_construct(std::move(rt.values), rt.index_value.get()); \
@@ -754,11 +754,11 @@ struct variant_base;
     }
 
 #define VULKAN_CPU_UTIL_VARIANT_BASE_MOVE_CONSTRUCTOR_false \
-    variant_base(variant_base &&rt) = delete;
+    Variant_base(Variant_base &&rt) = delete;
 
 #define VULKAN_CPU_UTIL_VARIANT_BASE_COPY_ASSIGN_OP_true                      \
-    variant_base &operator=(const variant_base &rt) noexcept(                 \
-        detail::variant_values<Types...>::is_nothrow_copy_assignable)         \
+    Variant_base &operator=(const Variant_base &rt) noexcept(                 \
+        Variant_values<Types...>::is_nothrow_copy_assignable)                 \
     {                                                                         \
         if(index_value.get() == rt.index_value.get())                         \
         {                                                                     \
@@ -775,11 +775,11 @@ struct variant_base;
     }
 
 #define VULKAN_CPU_UTIL_VARIANT_BASE_COPY_ASSIGN_OP_false \
-    variant_base &operator=(const variant_base &rt) = delete;
+    Variant_base &operator=(const Variant_base &rt) = delete;
 
 #define VULKAN_CPU_UTIL_VARIANT_BASE_MOVE_ASSIGN_OP_true                       \
-    variant_base &operator=(variant_base &&rt) noexcept(                       \
-        detail::variant_values<Types...>::is_nothrow_move_assignable)          \
+    Variant_base &operator=(Variant_base &&rt) noexcept(                       \
+        Variant_values<Types...>::is_nothrow_move_assignable)                  \
     {                                                                          \
         if(index_value.get() == rt.index_value.get())                          \
         {                                                                      \
@@ -796,7 +796,7 @@ struct variant_base;
     }
 
 #define VULKAN_CPU_UTIL_VARIANT_BASE_MOVE_ASSIGN_OP_false \
-    variant_base &operator=(variant_base &&rt) = delete;
+    Variant_base &operator=(Variant_base &&rt) = delete;
 
 #define VULKAN_CPU_UTIL_VARIANT_BASE0(Is_Trivially_Destructible,                         \
                                       Is_Copy_Constructible,                             \
@@ -804,21 +804,21 @@ struct variant_base;
                                       Is_Copy_Assignable,                                \
                                       Is_Move_Assignable)                                \
     template <typename... Types>                                                         \
-    struct variant_base<Is_Trivially_Destructible,                                       \
+    struct Variant_base<Is_Trivially_Destructible,                                       \
                         Is_Copy_Constructible,                                           \
                         Is_Move_Constructible,                                           \
                         Is_Copy_Assignable,                                              \
                         Is_Move_Assignable,                                              \
                         Types...>                                                        \
     {                                                                                    \
-        detail::variant_values<Types...> values;                                         \
-        detail::variant_index_type<sizeof...(Types)> index_value;                        \
+        Variant_values<Types...> values;                                                 \
+        Variant_index_type<sizeof...(Types)> index_value;                                \
         template <typename... Args>                                                      \
-        constexpr variant_base(                                                          \
-            variant_base_construct_tag,                                                  \
+        constexpr Variant_base(                                                          \
+            Variant_base_construct_tag,                                                  \
             std::size_t index_value,                                                     \
             Args &&... args) noexcept(noexcept(new(std::declval<void *>())               \
-                                                   detail::variant_values<Types...>(     \
+                                                   Variant_values<Types...>(             \
                                                        std::declval<Args>()...)))        \
             : values(std::forward<Args>(args)...), index_value(index_value)              \
         {                                                                                \
@@ -862,25 +862,25 @@ VULKAN_CPU_UTIL_VARIANT_BASE4(false)
 VULKAN_CPU_UTIL_VARIANT_BASE4(true)
 
 template <typename T>
-struct variant_is_in_place_index
+struct Variant_is_in_place_index
 {
     static constexpr bool value = false;
 };
 
 template <std::size_t I>
-struct variant_is_in_place_index<in_place_index_t<I>>
+struct Variant_is_in_place_index<in_place_index_t<I>>
 {
     static constexpr bool value = true;
 };
 
 template <typename T>
-struct variant_is_in_place_type
+struct Variant_is_in_place_type
 {
     static constexpr bool value = false;
 };
 
 template <typename T>
-struct variant_is_in_place_type<in_place_type_t<T>>
+struct Variant_is_in_place_type<in_place_type_t<T>>
 {
     static constexpr bool value = true;
 };
@@ -902,51 +902,51 @@ typename std::common_type<decltype(std::declval<Fn>()(std::declval<const Types &
     variant_dispatch(Fn &&fn, const variant<Types...> &&v, Args &&... args);
 
 template <typename... Types>
-using variant_base_t = variant_base<detail::variant_is_trivially_destructible<Types...>(),
-                                    detail::variant_values<Types...>::is_copy_constructible,
-                                    detail::variant_values<Types...>::is_move_constructible,
-                                    detail::variant_values<Types...>::is_copy_assignable,
-                                    detail::variant_values<Types...>::is_move_assignable,
+using Variant_base_t = Variant_base<variant_is_trivially_destructible<Types...>(),
+                                    Variant_values<Types...>::is_copy_constructible,
+                                    Variant_values<Types...>::is_move_constructible,
+                                    Variant_values<Types...>::is_copy_assignable,
+                                    Variant_values<Types...>::is_move_assignable,
                                     Types...>;
 }
 
 template <typename... Types>
-class variant : private detail::variant_base_t<Types...>
+class variant : private detail::Variant_base_t<Types...>
 {
     static_assert(sizeof...(Types) > 0, "empty variant is not permitted");
 
 private:
-    typedef typename detail::variant_values<Types...>::type_0 type_0;
-    typedef detail::variant_base_t<Types...> base;
+    typedef typename detail::Variant_values<Types...>::Type_0 Type_0;
+    typedef detail::Variant_base_t<Types...> Base;
 
 private:
-    using base::values;
-    using base::index_value;
+    using Base::values;
+    using Base::index_value;
 
 public:
     template <bool extra_condition = true,
               typename = typename std::
-                  enable_if<extra_condition && std::is_default_constructible<type_0>::value>::type>
-    constexpr variant() noexcept(std::is_nothrow_default_constructible<type_0>::value)
-        : base(detail::variant_base_construct_tag{}, 0)
+                  enable_if<extra_condition && std::is_default_constructible<Type_0>::value>::type>
+    constexpr variant() noexcept(std::is_nothrow_default_constructible<Type_0>::value)
+        : Base(detail::Variant_base_construct_tag{}, 0)
     {
     }
     template <
         typename T,
         typename Deduced_Type = typename decltype(
-            detail::variant_hypothetical_overload_set<Types...>::fn(std::declval<T>()))::type,
+            detail::Variant_hypothetical_overload_set<Types...>::fn(std::declval<T>()))::type,
         std::size_t Index =
-            detail::variant_values<Types...>::template index_from_type<Deduced_Type>(),
+            detail::Variant_values<Types...>::template index_from_type<Deduced_Type>(),
         typename = typename std::
             enable_if<(Index < sizeof...(Types))
                       && !std::is_same<typename std::decay<T>::type, variant>::value
-                      && !detail::variant_is_in_place_index<typename std::decay<T>::type>::value
-                      && !detail::variant_is_in_place_type<typename std::decay<T>::type>::value
+                      && !detail::Variant_is_in_place_index<typename std::decay<T>::type>::value
+                      && !detail::Variant_is_in_place_type<typename std::decay<T>::type>::value
                       && std::is_constructible<variant_alternative_t<Index, variant<Types...>>,
                                                T>::value>::type>
     constexpr variant(T &&value) noexcept(
         std::is_nothrow_constructible<variant_alternative_t<Index, variant<Types...>>, T>::value)
-        : base(detail::variant_base_construct_tag{},
+        : Base(detail::Variant_base_construct_tag{},
                Index,
                in_place_index<Index>,
                std::forward<T>(value))
@@ -954,12 +954,12 @@ public:
     }
     template <typename T,
               typename... Args,
-              std::size_t Index = detail::variant_values<Types...>::template index_from_type<T>(),
+              std::size_t Index = detail::Variant_values<Types...>::template index_from_type<T>(),
               typename = typename std::enable_if<(Index < sizeof...(Types))
                                                  && std::is_constructible<T, Args...>::value>::type>
     constexpr explicit variant(in_place_type_t<T>, Args &&... args) noexcept(
         std::is_nothrow_constructible<T, Args...>::value)
-        : base(detail::variant_base_construct_tag{},
+        : Base(detail::Variant_base_construct_tag{},
                Index,
                in_place_index<Index>,
                std::forward<Args>(args)...)
@@ -969,7 +969,7 @@ public:
         typename T,
         typename U,
         typename... Args,
-        std::size_t Index = detail::variant_values<Types...>::template index_from_type<T>(),
+        std::size_t Index = detail::Variant_values<Types...>::template index_from_type<T>(),
         typename = typename std::
             enable_if<(Index < sizeof...(Types))
                       && std::is_constructible<T, std::initializer_list<U>, Args...>::value>::type>
@@ -979,7 +979,7 @@ public:
         Args &&... args) noexcept(std::is_nothrow_constructible<T,
                                                                 std::initializer_list<U>,
                                                                 Args...>::value)
-        : base(detail::variant_base_construct_tag{},
+        : Base(detail::Variant_base_construct_tag{},
                Index,
                in_place_index<Index>,
                il,
@@ -994,7 +994,7 @@ public:
     constexpr explicit variant(in_place_index_t<Index>, Args &&... args) noexcept(
         std::is_nothrow_constructible<variant_alternative_t<Index, variant<Types...>>,
                                       Args...>::value)
-        : base(detail::variant_base_construct_tag{},
+        : Base(detail::Variant_base_construct_tag{},
                Index,
                in_place_index<Index>,
                std::forward<Args>(args)...)
@@ -1013,7 +1013,7 @@ public:
         noexcept(std::is_nothrow_constructible<variant_alternative_t<Index, variant<Types...>>,
                                                std::initializer_list<U>,
                                                Args...>::value)
-        : base(detail::variant_base_construct_tag{},
+        : Base(detail::Variant_base_construct_tag{},
                Index,
                in_place_index<Index>,
                il,
@@ -1023,14 +1023,14 @@ public:
     template <
         typename T,
         typename Deduced_Type = typename decltype(
-            detail::variant_hypothetical_overload_set<Types...>::fn(std::declval<T>()))::type,
+            detail::Variant_hypothetical_overload_set<Types...>::fn(std::declval<T>()))::type,
         std::size_t Index =
-            detail::variant_values<Types...>::template index_from_type<Deduced_Type>(),
+            detail::Variant_values<Types...>::template index_from_type<Deduced_Type>(),
         typename = typename std::
             enable_if<(Index < sizeof...(Types))
                       && !std::is_same<typename std::decay<T>::type, variant>::value
-                      && !detail::variant_is_in_place_index<typename std::decay<T>::type>::value
-                      && !detail::variant_is_in_place_type<typename std::decay<T>::type>::value
+                      && !detail::Variant_is_in_place_index<typename std::decay<T>::type>::value
+                      && !detail::Variant_is_in_place_type<typename std::decay<T>::type>::value
                       && std::is_constructible<variant_alternative_t<Index, variant<Types...>>,
                                                T>::value
                       && std::is_assignable<variant_alternative_t<Index, variant<Types...>>,
@@ -1041,13 +1041,13 @@ public:
     {
         if(index_value.get() == Index)
         {
-            detail::variant_get<Index, Types...>::get(values) = std::forward<T>(new_value);
+            detail::Variant_get<Index, Types...>::get(values) = std::forward<T>(new_value);
         }
         else
         {
             values.destruct(index_value.get());
             index_value.set(variant_npos); // in case construction throws
-            auto &value = detail::variant_get<Index, Types...>::get(values);
+            auto &value = detail::Variant_get<Index, Types...>::get(values);
             new(const_cast<void *>(static_cast<const volatile void *>(std::addressof(value))))
                 variant_alternative_t<Index, variant<Types...>>(std::forward<T>(new_value));
             index_value.set(Index);
@@ -1056,7 +1056,7 @@ public:
     }
     template <typename T,
               typename... Args,
-              std::size_t Index = detail::variant_values<Types...>::template index_from_type<T>(),
+              std::size_t Index = detail::Variant_values<Types...>::template index_from_type<T>(),
               typename = typename std::enable_if<(Index < sizeof...(Types))
                                                  && std::is_constructible<T, Args...>::value>::type>
     void emplace(Args &&... args)
@@ -1067,7 +1067,7 @@ public:
         typename T,
         typename U,
         typename... Args,
-        std::size_t Index = detail::variant_values<Types...>::template index_from_type<T>(),
+        std::size_t Index = detail::Variant_values<Types...>::template index_from_type<T>(),
         typename = typename std::
             enable_if<(Index < sizeof...(Types))
                       && std::is_constructible<T, std::initializer_list<U>, Args...>::value>::type>
@@ -1086,7 +1086,7 @@ public:
     {
         values.destruct(index_value.get());
         index_value.set(variant_npos); // in case construction throws
-        auto &value = detail::variant_get<Index, Types...>::get(values);
+        auto &value = detail::Variant_get<Index, Types...>::get(values);
         new(const_cast<void *>(static_cast<const volatile void *>(std::addressof(value))))
             variant_alternative_t<Index, variant<Types...>>(std::forward<Args>(args)...);
         index_value.set(Index);
@@ -1104,7 +1104,7 @@ public:
     {
         values.destruct(index_value.get());
         index_value.set(variant_npos); // in case construction throws
-        auto &value = detail::variant_get<Index, Types...>::get(values);
+        auto &value = detail::Variant_get<Index, Types...>::get(values);
         new(const_cast<void *>(static_cast<const volatile void *>(std::addressof(value))))
             variant_alternative_t<Index, variant<Types...>>(il, std::forward<Args>(args)...);
         index_value.set(Index);
@@ -1120,8 +1120,8 @@ public:
     template <bool extra_condition = true,
               typename =
                   typename std::enable_if<extra_condition
-                                          && detail::variant_values<Types...>::is_swappable>::type>
-    void swap(variant &rt) noexcept(detail::variant_values<Types...>::is_nothrow_swappable)
+                                          && detail::Variant_values<Types...>::is_swappable>::type>
+    void swap(variant &rt) noexcept(detail::Variant_values<Types...>::is_nothrow_swappable)
     {
         if(index_value.get() == rt.index_value.get())
             values.swap(rt.values, index_value.get());
@@ -1141,14 +1141,14 @@ public:
         const variant<Types2...> &v);
     template <typename... Types2>
     friend constexpr
-        typename std::enable_if<detail::variant_values<Types2...>::is_equals_comparable, bool>::type
+        typename std::enable_if<detail::Variant_values<Types2...>::is_equals_comparable, bool>::type
         operator==(const variant<Types2...> &l, const variant<Types2...> &r) noexcept(
-            detail::variant_values<Types2...>::is_nothrow_equals_comparable);
+            detail::Variant_values<Types2...>::is_nothrow_equals_comparable);
     template <typename... Types2>
     friend constexpr
-        typename std::enable_if<detail::variant_values<Types2...>::is_less_comparable, bool>::type
+        typename std::enable_if<detail::Variant_values<Types2...>::is_less_comparable, bool>::type
         operator<(const variant<Types2...> &l, const variant<Types2...> &r) noexcept(
-            detail::variant_values<Types2...>::is_nothrow_less_comparable);
+            detail::Variant_values<Types2...>::is_nothrow_less_comparable);
     template <typename Fn, typename... Types2, typename... Args>
     friend
         typename std::common_type<decltype(std::declval<Fn>()(std::declval<Types2 &>()))...>::type
@@ -1170,7 +1170,7 @@ public:
 template <typename T, typename... Types>
 constexpr bool holds_alternative(const variant<Types...> &v) noexcept
 {
-    constexpr std::size_t index = detail::variant_values<Types...>::template index_from_type<T>();
+    constexpr std::size_t index = detail::Variant_values<Types...>::template index_from_type<T>();
     static_assert(index != variant_npos, "");
     return v.index_value.get() == index;
 }
@@ -1180,7 +1180,7 @@ constexpr variant_alternative_t<Index, variant<Types...>> &get(variant<Types...>
 {
     static_assert(Index < sizeof...(Types), "");
     if(v.index_value.get() == Index)
-        return detail::variant_get<Index, Types...>::get(v.values);
+        return detail::Variant_get<Index, Types...>::get(v.values);
     throw bad_variant_access();
 }
 
@@ -1189,7 +1189,7 @@ constexpr const variant_alternative_t<Index, variant<Types...>> &get(const varia
 {
     static_assert(Index < sizeof...(Types), "");
     if(v.index_value.get() == Index)
-        return detail::variant_get<Index, Types...>::get(v.values);
+        return detail::Variant_get<Index, Types...>::get(v.values);
     throw bad_variant_access();
 }
 
@@ -1208,25 +1208,25 @@ constexpr variant_alternative_t<Index, variant<Types...>> &&get(variant<Types...
 template <typename T, typename... Types>
 constexpr const T &get(const variant<Types...> &v)
 {
-    return get<detail::variant_values<Types...>::template index_from_type<T>()>(v);
+    return get<detail::Variant_values<Types...>::template index_from_type<T>()>(v);
 }
 
 template <typename T, typename... Types>
 constexpr T &get(variant<Types...> &v)
 {
-    return get<detail::variant_values<Types...>::template index_from_type<T>()>(v);
+    return get<detail::Variant_values<Types...>::template index_from_type<T>()>(v);
 }
 
 template <typename T, typename... Types>
 constexpr const T &&get(const variant<Types...> &&v)
 {
-    return get<detail::variant_values<Types...>::template index_from_type<T>()>(std::move(v));
+    return get<detail::Variant_values<Types...>::template index_from_type<T>()>(std::move(v));
 }
 
 template <typename T, typename... Types>
 constexpr T &&get(variant<Types...> &&v)
 {
-    return get<detail::variant_values<Types...>::template index_from_type<T>()>(std::move(v));
+    return get<detail::Variant_values<Types...>::template index_from_type<T>()>(std::move(v));
 }
 
 template <std::size_t Index, typename... Types>
@@ -1251,20 +1251,20 @@ constexpr variant_alternative_t<Index, variant<Types...>> *get_if(variant<Types.
 template <typename T, typename... Types>
 constexpr const T *get_if(const variant<Types...> *v) noexcept
 {
-    return get_if<detail::variant_values<Types...>::template index_from_type<T>()>(v);
+    return get_if<detail::Variant_values<Types...>::template index_from_type<T>()>(v);
 }
 
 template <typename T, typename... Types>
 constexpr T *get_if(variant<Types...> *v) noexcept
 {
-    return get_if<detail::variant_values<Types...>::template index_from_type<T>()>(v);
+    return get_if<detail::Variant_values<Types...>::template index_from_type<T>()>(v);
 }
 
 template <typename... Types>
 constexpr
-    typename std::enable_if<detail::variant_values<Types...>::is_equals_comparable, bool>::type
+    typename std::enable_if<detail::Variant_values<Types...>::is_equals_comparable, bool>::type
     operator==(const variant<Types...> &l, const variant<Types...> &r) noexcept(
-        detail::variant_values<Types...>::is_nothrow_equals_comparable)
+        detail::Variant_values<Types...>::is_nothrow_equals_comparable)
 {
     return l.index_value.get() == r.index_value.get()
            && l.values.is_equal(r.values, l.index_value.get());
@@ -1272,17 +1272,17 @@ constexpr
 
 template <typename... Types>
 constexpr
-    typename std::enable_if<detail::variant_values<Types...>::is_equals_comparable, bool>::type
+    typename std::enable_if<detail::Variant_values<Types...>::is_equals_comparable, bool>::type
     operator!=(const variant<Types...> &l, const variant<Types...> &r) noexcept(
-        detail::variant_values<Types...>::is_nothrow_equals_comparable)
+        detail::Variant_values<Types...>::is_nothrow_equals_comparable)
 {
     return !operator==(l, r);
 }
 
 template <typename... Types>
-constexpr typename std::enable_if<detail::variant_values<Types...>::is_less_comparable, bool>::type
+constexpr typename std::enable_if<detail::Variant_values<Types...>::is_less_comparable, bool>::type
     operator<(const variant<Types...> &l, const variant<Types...> &r) noexcept(
-        detail::variant_values<Types...>::is_nothrow_less_comparable)
+        detail::Variant_values<Types...>::is_nothrow_less_comparable)
 {
     if(l.index_value.get() != r.index_value.get())
         return l.index_value.get() < r.index_value.get();
@@ -1290,25 +1290,25 @@ constexpr typename std::enable_if<detail::variant_values<Types...>::is_less_comp
 }
 
 template <typename... Types>
-constexpr typename std::enable_if<detail::variant_values<Types...>::is_less_comparable, bool>::type
+constexpr typename std::enable_if<detail::Variant_values<Types...>::is_less_comparable, bool>::type
     operator>(const variant<Types...> &l, const variant<Types...> &r) noexcept(
-        detail::variant_values<Types...>::is_nothrow_less_comparable)
+        detail::Variant_values<Types...>::is_nothrow_less_comparable)
 {
     return operator<(r, l);
 }
 
 template <typename... Types>
-constexpr typename std::enable_if<detail::variant_values<Types...>::is_less_comparable, bool>::type
+constexpr typename std::enable_if<detail::Variant_values<Types...>::is_less_comparable, bool>::type
     operator>=(const variant<Types...> &l, const variant<Types...> &r) noexcept(
-        detail::variant_values<Types...>::is_nothrow_less_comparable)
+        detail::Variant_values<Types...>::is_nothrow_less_comparable)
 {
     return !operator<(l, r);
 }
 
 template <typename... Types>
-constexpr typename std::enable_if<detail::variant_values<Types...>::is_less_comparable, bool>::type
+constexpr typename std::enable_if<detail::Variant_values<Types...>::is_less_comparable, bool>::type
     operator<=(const variant<Types...> &l, const variant<Types...> &r) noexcept(
-        detail::variant_values<Types...>::is_nothrow_less_comparable)
+        detail::Variant_values<Types...>::is_nothrow_less_comparable)
 {
     return !operator<(r, l);
 }
@@ -1439,10 +1439,10 @@ struct hash<vulkan_cpu::util::variant<Types...>>
 
 template <typename... Types,
           typename = typename std::
-              enable_if<vulkan_cpu::util::detail::variant_values<Types...>::is_swappable>::type>
+              enable_if<vulkan_cpu::util::detail::Variant_values<Types...>::is_swappable>::type>
 inline void
     swap(vulkan_cpu::util::variant<Types...> &l, vulkan_cpu::util::variant<Types...> &r) noexcept(
-        vulkan_cpu::util::detail::variant_values<Types...>::is_nothrow_swappable)
+        vulkan_cpu::util::detail::Variant_values<Types...>::is_nothrow_swappable)
 {
     l.swap(r);
 }
index 7c280f0c542a9cab248021bf0e82065b8e9df536..5aed59e91c7c1b0efb455af2ba8df546199901bd 100644 (file)
@@ -31,14 +31,14 @@ namespace util
 namespace detail
 {
 template <typename... Types>
-struct void_t_helper
+struct Void_t_helper
 {
     typedef void type;
 };
 }
 
 template <typename... Types>
-using void_t = typename detail::void_t_helper<Types...>::type;
+using void_t = typename detail::Void_t_helper<Types...>::type;
 }
 }