Преглед изворни кода

Remove IdT from ValueStoreTypes (#5761)

`IdT` is no longer needed because `ValueT` is always supplied.
Jon Ross-Perkins пре 10 месеци
родитељ
комит
5b0ae6e784

+ 3 - 3
toolchain/base/canonical_value_store.h

@@ -26,9 +26,9 @@ template <typename IdT, typename KeyT, typename ValueT = KeyT>
 class CanonicalValueStore {
 class CanonicalValueStore {
  public:
  public:
   using KeyType = std::remove_cvref_t<KeyT>;
   using KeyType = std::remove_cvref_t<KeyT>;
-  using ValueType = ValueStoreTypes<IdT, ValueT>::ValueType;
-  using RefType = ValueStoreTypes<IdT, ValueT>::RefType;
-  using ConstRefType = ValueStoreTypes<IdT, ValueT>::ConstRefType;
+  using ValueType = ValueStoreTypes<ValueT>::ValueType;
+  using RefType = ValueStoreTypes<ValueT>::RefType;
+  using ConstRefType = ValueStoreTypes<ValueT>::ConstRefType;
 
 
   // Stores a canonical copy of the value and returns an ID to reference it.
   // Stores a canonical copy of the value and returns an ID to reference it.
   auto Add(ValueType value) -> IdT;
   auto Add(ValueType value) -> IdT;

+ 3 - 3
toolchain/base/fixed_size_value_store.h

@@ -19,9 +19,9 @@ template <typename IdT, typename ValueT>
 class FixedSizeValueStore {
 class FixedSizeValueStore {
  public:
  public:
   using IdType = IdT;
   using IdType = IdT;
-  using ValueType = ValueStoreTypes<IdT, ValueT>::ValueType;
-  using RefType = ValueStoreTypes<IdT, ValueT>::RefType;
-  using ConstRefType = ValueStoreTypes<IdT, ValueT>::ConstRefType;
+  using ValueType = ValueStoreTypes<ValueT>::ValueType;
+  using RefType = ValueStoreTypes<ValueT>::RefType;
+  using ConstRefType = ValueStoreTypes<ValueT>::ConstRefType;
 
 
   // Makes a ValueStore of the specified size, but without initializing values.
   // Makes a ValueStore of the specified size, but without initializing values.
   // Entries must be set before reading.
   // Entries must be set before reading.

+ 2 - 2
toolchain/base/relational_value_store.h

@@ -33,8 +33,8 @@ namespace Carbon {
 template <typename RelatedIdT, typename IdT, typename ValueT>
 template <typename RelatedIdT, typename IdT, typename ValueT>
 class RelationalValueStore {
 class RelationalValueStore {
  public:
  public:
-  using ValueType = ValueStoreTypes<IdT, ValueT>::ValueType;
-  using ConstRefType = ValueStoreTypes<IdT, ValueT>::ConstRefType;
+  using ValueType = ValueStoreTypes<ValueT>::ValueType;
+  using ConstRefType = ValueStoreTypes<ValueT>::ConstRefType;
 
 
   // Given the related ID and a value, stores the value and returns a mapped ID
   // Given the related ID and a value, stores the value and returns a mapped ID
   // to reference it in the store.
   // to reference it in the store.

+ 3 - 3
toolchain/base/value_store.h

@@ -40,9 +40,9 @@ class ValueStore
                               Internal::ValueStoreNotPrintable> {
                               Internal::ValueStoreNotPrintable> {
  public:
  public:
   using IdType = IdT;
   using IdType = IdT;
-  using ValueType = ValueStoreTypes<IdT, ValueT>::ValueType;
-  using RefType = ValueStoreTypes<IdT, ValueT>::RefType;
-  using ConstRefType = ValueStoreTypes<IdT, ValueT>::ConstRefType;
+  using ValueType = ValueStoreTypes<ValueT>::ValueType;
+  using RefType = ValueStoreTypes<ValueT>::RefType;
+  using ConstRefType = ValueStoreTypes<ValueT>::ConstRefType;
 
 
   // A range over references to the values in a ValueStore, returned from
   // A range over references to the values in a ValueStore, returned from
   // `ValueStore::values()`. Hides the complex type name of the iterator
   // `ValueStore::values()`. Hides the complex type name of the iterator

+ 1 - 1
toolchain/base/value_store_types.h

@@ -13,7 +13,7 @@
 namespace Carbon {
 namespace Carbon {
 
 
 // Common calculation for ValueStore types.
 // Common calculation for ValueStore types.
-template <typename IdT, typename ValueT = IdT::ValueType>
+template <typename ValueT>
 class ValueStoreTypes {
 class ValueStoreTypes {
  public:
  public:
   using ValueType = std::remove_cvref_t<ValueT>;
   using ValueType = std::remove_cvref_t<ValueT>;