History

Ensure a C++ object exists for all static const members of structs or create constexpr functions. - This is an attempt to adhere to the letter of the C++ specification.

arr committed 9 years ago

Commit af5c7a91 parent 4d839d714 files · +86 −64Browse files

Showing the changes to src/asm/sbl_reader.cpp (1 of 14 files). Show all

Unified · Split

src/asm/sbl_reader.cpp+13−6
@@ -96,12 +96,12 @@ namespace · 95 unmodified lines
9696
9797 struct type_table_t
9898 {
99− static const uint32_t string_table_mask = 0x80000000;
100− static const uint32_t inner_type_table_mask = 0x40000000;
101− static const uint32_t source_table_mask = 0x20000000;
102− static const uint32_t adt_table_mask = 0x10000000;
103− static const uint32_t tuple_type_mask = 0x08000000;
104− static const uint32_t types_mask = 0;
99+ static const uint32_t string_table_mask;
100+ static const uint32_t inner_type_table_mask;
101+ static const uint32_t source_table_mask;
102+ static const uint32_t adt_table_mask;
103+ static const uint32_t tuple_type_mask;
104+ static const uint32_t types_mask;
105105
106106 std::vector<type_t> types;
107107 std::vector<std::string> strings_table;
@@ -114,6 +114,13 @@ namespace · 6 unmodified lines
114114 const T &resolve_table_index(int32_t idx) const;
115115 };
116116
117+ const uint32_t type_table_t::string_table_mask = 0x80000000;
118+ const uint32_t type_table_t::inner_type_table_mask = 0x40000000;
119+ const uint32_t type_table_t::source_table_mask = 0x20000000;
120+ const uint32_t type_table_t::adt_table_mask = 0x10000000;
121+ const uint32_t type_table_t::tuple_type_mask = 0x08000000;
122+ const uint32_t type_table_t::types_mask = 0;
123+
117124 template<>
118125 const std::string &type_table_t::resolve_table_index<std::string>(int32_t idx) const
119126 {