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
96 96
97 struct type_table_t97 struct type_table_t
98 {98 {
99 static const uint32_t string_table_mask = 0x80000000;99 static const uint32_t string_table_mask;
100 static const uint32_t inner_type_table_mask = 0x40000000;100 static const uint32_t inner_type_table_mask;
101 static const uint32_t source_table_mask = 0x20000000;101 static const uint32_t source_table_mask;
102 static const uint32_t adt_table_mask = 0x10000000;102 static const uint32_t adt_table_mask;
103 static const uint32_t tuple_type_mask = 0x08000000;103 static const uint32_t tuple_type_mask;
104 static const uint32_t types_mask = 0;104 static const uint32_t types_mask;
105 105
106 std::vector<type_t> types;106 std::vector<type_t> types;
107 std::vector<std::string> strings_table;107 std::vector<std::string> strings_table;
@@ -114,6 +114,13 @@ namespace · 6 unmodified lines
114 const T &resolve_table_index(int32_t idx) const;114 const T &resolve_table_index(int32_t idx) const;
115 };115 };
116 116
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
117 template<>124 template<>
118 const std::string &type_table_t::resolve_table_index<std::string>(int32_t idx) const125 const std::string &type_table_t::resolve_table_index<std::string>(int32_t idx) const
119 {126 {