diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-12-21 16:27:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-21 16:27:14 +0100 |
commit | a3d5e2ce14352ab181e940574f6e1a99d40cd520 (patch) | |
tree | dca3f6298ffec75df06d3023b68f5a7f67465c88 | |
parent | 83123af3b0102b1471dc3701770ad5cec8951853 (diff) | |
parent | b65ada009591fc728058f3993e31315ed592fe42 (diff) |
Merge pull request #25314 from vespa-engine/geirst/typedef-to-using-in-searchlib
Change from typedef to using in searchlib C++ code.
279 files changed, 936 insertions, 951 deletions
diff --git a/searchlib/src/apps/tests/biglogtest.cpp b/searchlib/src/apps/tests/biglogtest.cpp index 154e94d0c66..8795351ad64 100644 --- a/searchlib/src/apps/tests/biglogtest.cpp +++ b/searchlib/src/apps/tests/biglogtest.cpp @@ -19,7 +19,7 @@ private: char *buf; Blob(size_t s) : sz(s), buf(s == 0 ? 0 : new char[s]) {} }; - typedef std::map<uint32_t, uint32_t> Map; + using Map = std::map<uint32_t, uint32_t>; void makeBlobs(); void cleanBlobs(); diff --git a/searchlib/src/apps/uniform/uniform.cpp b/searchlib/src/apps/uniform/uniform.cpp index a72a13464fd..784c69f4647 100644 --- a/searchlib/src/apps/uniform/uniform.cpp +++ b/searchlib/src/apps/uniform/uniform.cpp @@ -15,7 +15,7 @@ maxExpGolombVal(uint64_t kValue, uint64_t maxBits) class UniformApp { - typedef search::bitcompression::EncodeContext64BE EC64; + using EC64 = search::bitcompression::EncodeContext64BE; enum { MAXK = 30 diff --git a/searchlib/src/apps/vespa-attribute-inspect/vespa-attribute-inspect.cpp b/searchlib/src/apps/vespa-attribute-inspect/vespa-attribute-inspect.cpp index 5833f9cc904..75fb1f9139e 100644 --- a/searchlib/src/apps/vespa-attribute-inspect/vespa-attribute-inspect.cpp +++ b/searchlib/src/apps/vespa-attribute-inspect/vespa-attribute-inspect.cpp @@ -14,7 +14,7 @@ namespace search { -typedef AttributeVector::SP AttributePtr; +using AttributePtr = AttributeVector::SP; class LoadAttribute { diff --git a/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp b/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp index 073a5d2884d..a5d950c0f31 100644 --- a/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp +++ b/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp @@ -570,10 +570,10 @@ ShowPostingListSubApp::showPostingList() offsetAndCounts._counts._bitLength, offsetAndCounts._counts._numDocs); } - typedef PostingListCounts Counts; - typedef PostingListHandle Handle; - typedef std::pair<Counts, Handle> CH; - typedef std::unique_ptr<CH> CHAP; + using Counts = PostingListCounts; + using Handle = PostingListHandle; + using CH = std::pair<Counts, Handle>; + using CHAP = std::unique_ptr<CH>; CHAP handle(new CH); handle->first = offsetAndCounts._counts; handle->second._bitOffset = offsetAndCounts._offset; diff --git a/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp b/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp index dee7d6f650d..53d27076486 100644 --- a/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp +++ b/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp @@ -72,7 +72,7 @@ struct InputInfo { //----------------------------------------------------------------------------- struct FunctionInfo { - typedef std::vector<const Node *> TreeList; + using TreeList = std::vector<const Node *>; size_t expression_size; bool root_is_forest; diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp index a0906e2a488..5c0e2c26bd2 100644 --- a/searchlib/src/tests/attribute/attribute_test.cpp +++ b/searchlib/src/tests/attribute/attribute_test.cpp @@ -179,7 +179,7 @@ using attribute::Config; class AttributeTest : public ::testing::Test { protected: - typedef AttributeVector::SP AttributePtr; + using AttributePtr = AttributeVector::SP; void addDocs(const AttributePtr & v, size_t sz); void addClearedDocs(const AttributePtr & v, size_t sz); @@ -1303,7 +1303,7 @@ AttributeTest::testArithmeticValueUpdate(const AttributePtr & ptr) { LOG(info, "testArithmeticValueUpdate: vector '%s'", ptr->getName().c_str()); - typedef document::ArithmeticValueUpdate Arith; + using Arith = document::ArithmeticValueUpdate; auto & vec = static_cast<VectorType &>(*ptr.get()); addDocs(ptr, 13); EXPECT_EQ(ptr->getStatus().getUpdateCount(), 0u); @@ -1472,7 +1472,7 @@ AttributeTest::testArithmeticWithUndefinedValue(const AttributePtr & ptr, BaseTy { LOG(info, "testArithmeticWithUndefinedValue: vector '%s'", ptr->getName().c_str()); - typedef document::ArithmeticValueUpdate Arith; + using Arith = document::ArithmeticValueUpdate; auto & vec = static_cast<VectorType &>(*ptr.get()); addDocs(ptr, 1); ASSERT_TRUE(vec.update(0, before)); @@ -1519,8 +1519,8 @@ AttributeTest::testMapValueUpdate(const AttributePtr & ptr, BufferType initValue bool removeIfZero, bool createIfNonExistant) { LOG(info, "testMapValueUpdate: vector '%s'", ptr->getName().c_str()); - typedef MapValueUpdate MapVU; - typedef ArithmeticValueUpdate ArithVU; + using MapVU = MapValueUpdate; + using ArithVU = ArithmeticValueUpdate; auto & vec = static_cast<VectorType &>(*ptr.get()); addDocs(ptr, 7); diff --git a/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp b/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp index 9b6187bcc77..1d3995bc494 100644 --- a/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp +++ b/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp @@ -183,12 +183,12 @@ assertCollectionType(CollectionType exp, AttributesConfig::Attribute::Collection TEST("require that config can be converted") { - typedef BT AVBT; - typedef CollectionType AVCT; + using AVBT = BT; + using AVCT = CollectionType; using CACA = AttributesConfig::Attribute; using CACAD = CACA::Datatype; using CACAC = CACA::Collectiontype; - typedef ConfigConverter CC; + using CC = ConfigConverter; EXPECT_TRUE(assertDataType(AVBT::STRING, CACAD::STRING)); EXPECT_TRUE(assertDataType(AVBT::INT8, CACAD::INT8)); diff --git a/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp b/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp index 39e5d713d08..0b90b4eae95 100644 --- a/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp +++ b/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp @@ -18,9 +18,9 @@ LOG_SETUP("attributebenchmark"); using std::shared_ptr; -typedef std::vector<uint32_t> NumVector; -typedef std::vector<vespalib::string> StringVector; -typedef search::attribute::Config AttrConfig; +using NumVector = std::vector<uint32_t>; +using StringVector = std::vector<vespalib::string>; +using AttrConfig = search::attribute::Config; using search::attribute::BasicType; using search::attribute::CollectionType; diff --git a/searchlib/src/tests/attribute/benchmark/attributesearcher.h b/searchlib/src/tests/attribute/benchmark/attributesearcher.h index 43531b48f05..d6e14d6793d 100644 --- a/searchlib/src/tests/attribute/benchmark/attributesearcher.h +++ b/searchlib/src/tests/attribute/benchmark/attributesearcher.h @@ -62,7 +62,7 @@ public: class AttributeSearcher : public Runnable { protected: - typedef AttributeVector::SP AttributePtr; + using AttributePtr = AttributeVector::SP; const AttributePtr & _attrPtr; vespalib::Timer _timer; diff --git a/searchlib/src/tests/attribute/benchmark/attributeupdater.h b/searchlib/src/tests/attribute/benchmark/attributeupdater.h index e1aea8c7d90..88220a8cfb8 100644 --- a/searchlib/src/tests/attribute/benchmark/attributeupdater.h +++ b/searchlib/src/tests/attribute/benchmark/attributeupdater.h @@ -90,8 +90,8 @@ template <typename Vector, typename T, typename BT> class AttributeUpdater { protected: - typedef AttributeVector::SP AttributePtr; - typedef std::map<uint32_t, std::vector<T> > AttributeCommit; + using AttributePtr = AttributeVector::SP; + using AttributeCommit = std::map<uint32_t, std::vector<T> >; const AttributePtr & _attrPtr; Vector & _attrVec; @@ -156,7 +156,7 @@ template <typename Vector, typename T, typename BT> class AttributeUpdaterThread : public AttributeUpdater<Vector, T, BT>, public Runnable { private: - typedef AttributeVector::SP AttributePtr; + using AttributePtr = AttributeVector::SP; public: AttributeUpdaterThread(const AttributePtr & attrPtr, const std::vector<T> & values, diff --git a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp index 7cfe7eaab75..6e622c840b6 100644 --- a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp +++ b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp @@ -37,11 +37,11 @@ using search::fef::TermFieldMatchData; using search::queryeval::SearchIterator; using SearchContextPtr = std::unique_ptr<SearchContext>; -typedef std::unique_ptr<search::queryeval::SearchIterator> SearchBasePtr; +using SearchBasePtr = std::unique_ptr<search::queryeval::SearchIterator>; struct BitVectorTest { - typedef AttributeVector::SP AttributePtr; + using AttributePtr = AttributeVector::SP; BitVectorTest() { } @@ -477,8 +477,8 @@ BitVectorTest::test(BasicType bt, if (dwa != nullptr) { search::IDocumentWeightAttribute::LookupResult lres = dwa->lookup(getSearchStr<VectorType>(), dwa->get_dictionary_snapshot()); - typedef search::queryeval::DocumentWeightSearchIterator DWSI; - typedef search::queryeval::SearchIterator SI; + using DWSI = search::queryeval::DocumentWeightSearchIterator; + using SI = search::queryeval::SearchIterator; TermFieldMatchData md; SI::UP dwsi(new DWSI(md, *dwa, lres)); if (!enableOnlyBitVector) { diff --git a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp index 90127e9ae7b..820f39089d1 100644 --- a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp +++ b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp @@ -44,7 +44,7 @@ using search::attribute::SearchContextParams; using search::fef::TermFieldMatchData; using SearchContextPtr = std::unique_ptr<SearchContext>; -typedef std::unique_ptr<search::queryeval::SearchIterator> SearchBasePtr; +using SearchBasePtr = std::unique_ptr<search::queryeval::SearchIterator>; class MemAttrFileWriter : public IAttributeFileWriter @@ -93,7 +93,7 @@ private: MemAttrFileWriter _udatWriter; public: - typedef std::shared_ptr<MemAttr> SP; + using SP = std::shared_ptr<MemAttr>; MemAttr(); ~MemAttr() override; @@ -129,7 +129,7 @@ MemAttr::~MemAttr() = default; class EnumeratedSaveTest { private: - typedef AttributeVector::SP AttributePtr; + using AttributePtr = AttributeVector::SP; template <typename VectorType> VectorType & as(AttributePtr &v); @@ -623,9 +623,7 @@ EnumeratedSaveTest::testReload(AttributePtr v0, bool fastSearch, search::DictionaryConfig dictionary_config) { - // typedef AttributePtr AVP; - - bool flagAttr = + bool flagAttr = cfg.collectionType() == CollectionType::ARRAY && cfg.basicType() == BasicType::INT8 && fastSearch; diff --git a/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp b/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp index 2f60d64ec37..22584db7dd9 100644 --- a/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp +++ b/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp @@ -109,9 +109,9 @@ struct StringEntry { }; struct Reader { - typedef StringEnumStore::Index Index; - typedef std::vector<Index> IndexVector; - typedef std::vector<StringEntry> ExpectedVector; + using Index = StringEnumStore::Index; + using IndexVector = std::vector<Index>; + using ExpectedVector = std::vector<StringEntry>; uint32_t _generation; IndexVector _indices; ExpectedVector _expected; diff --git a/searchlib/src/tests/attribute/postinglist/postinglist.cpp b/searchlib/src/tests/attribute/postinglist/postinglist.cpp index 1eed3a015e1..3f07faa159f 100644 --- a/searchlib/src/tests/attribute/postinglist/postinglist.cpp +++ b/searchlib/src/tests/attribute/postinglist/postinglist.cpp @@ -27,8 +27,8 @@ class AttributePostingListTest : public vespalib::TestApp { private: /* Limited STL version for validation of full version */ - typedef std::set<uint32_t> STLPostingList; - typedef std::map<int, STLPostingList> STLValueTree; + using STLPostingList = std::set<uint32_t>; + using STLValueTree = std::map<int, STLPostingList>; class RandomValue { @@ -96,18 +96,16 @@ private: std::vector<RandomValue> _randomValues; public: - typedef vespalib::datastore::DataStore<int> IntKeyStore; - typedef vespalib::btree::BTreeKeyData<uint32_t, vespalib::btree::BTreeNoLeafData> - AttributePosting; - typedef vespalib::btree::BTreeStore<uint32_t, + using IntKeyStore = vespalib::datastore::DataStore<int>; + using AttributePosting = vespalib::btree::BTreeKeyData<uint32_t, vespalib::btree::BTreeNoLeafData>; + using PostingList = vespalib::btree::BTreeStore<uint32_t, vespalib::btree::BTreeNoLeafData, vespalib::btree::NoAggregated, std::less<uint32_t>, - vespalib::btree::BTreeDefaultTraits> - PostingList; - typedef PostingList::NodeAllocatorType PostingListNodeAllocator; - typedef vespalib::datastore::EntryRef PostingIdx; - typedef vespalib::datastore::EntryRef StoreIndex; + vespalib::btree::BTreeDefaultTraits>; + using PostingListNodeAllocator = PostingList::NodeAllocatorType; + using PostingIdx = vespalib::datastore::EntryRef; + using StoreIndex = vespalib::datastore::EntryRef; class IntComp { private: @@ -127,14 +125,14 @@ public: } }; - typedef vespalib::btree::BTreeRoot<StoreIndex, PostingIdx, + using IntEnumTree = vespalib::btree::BTreeRoot<StoreIndex, PostingIdx, vespalib::btree::NoAggregated, - const IntComp &> IntEnumTree; - typedef IntEnumTree::NodeAllocatorType IntEnumNodeAllocator; - typedef IntEnumTree Tree; - typedef IntEnumNodeAllocator TreeManager; - typedef IntKeyStore ValueHandle; - typedef std::vector<RandomValue> RandomValuesVector; + const IntComp &>; + using IntEnumNodeAllocator = IntEnumTree::NodeAllocatorType; + using Tree = IntEnumTree; + using TreeManager = IntEnumNodeAllocator; + using ValueHandle = IntKeyStore; + using RandomValuesVector = std::vector<RandomValue>; private: GenerationHandler _handler; IntKeyStore *_intKeyStore; @@ -607,7 +605,7 @@ AttributePostingListTest::doCompactEnumStore(Tree &tree, std::atomic_thread_fence(std::memory_order_release); i.writeKey(nv); } - typedef GenerationHandler::generation_t generation_t; + using generation_t = GenerationHandler::generation_t; for (std::vector<uint32_t>::const_iterator it = toHold.begin(), ite = toHold.end(); it != ite; ++it) { valueHandle.holdBuffer(*it); diff --git a/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp b/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp index 5ce20c06ab5..00e2a82d24e 100644 --- a/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp +++ b/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp @@ -51,7 +51,7 @@ using search::fef::TermFieldMatchData; using search::queryeval::SearchIterator; using SearchContextPtr = std::unique_ptr<SearchContext>; -typedef std::unique_ptr<search::queryeval::SearchIterator> SearchBasePtr; +using SearchBasePtr = std::unique_ptr<search::queryeval::SearchIterator>; void toStr(std::stringstream &ss, SearchIterator &it, TermFieldMatchData *md) @@ -91,36 +91,30 @@ using AttributePtr = AttributeVector::SP; class PostingListAttributeTest : public ::testing::Test { protected: - typedef IntegerAttribute::largeint_t largeint_t; - typedef std::set<AttributeVector::DocId> DocSet; + using largeint_t = IntegerAttribute::largeint_t; + using DocSet = std::set<AttributeVector::DocId>; - typedef SingleValueNumericPostingAttribute< - EnumAttribute<IntegerAttributeTemplate<int32_t> > > - Int32PostingListAttribute; - typedef MultiValueNumericPostingAttribute< + using Int32PostingListAttribute = SingleValueNumericPostingAttribute< + EnumAttribute<IntegerAttributeTemplate<int32_t> > >; + using Int32ArrayPostingListAttribute = MultiValueNumericPostingAttribute< EnumAttribute<IntegerAttributeTemplate<int32_t> >, - IEnumStore::AtomicIndex> - Int32ArrayPostingListAttribute; - typedef MultiValueNumericPostingAttribute< + IEnumStore::AtomicIndex>; + using Int32WsetPostingListAttribute = MultiValueNumericPostingAttribute< EnumAttribute<IntegerAttributeTemplate<int32_t> >, - multivalue::WeightedValue<IEnumStore::AtomicIndex> > - Int32WsetPostingListAttribute; + multivalue::WeightedValue<IEnumStore::AtomicIndex> >; - typedef SingleValueNumericPostingAttribute< - EnumAttribute<FloatingPointAttributeTemplate<float> > > - FloatPostingListAttribute; - typedef MultiValueNumericPostingAttribute< + using FloatPostingListAttribute = SingleValueNumericPostingAttribute< + EnumAttribute<FloatingPointAttributeTemplate<float> > >; + using FloatArrayPostingListAttribute = MultiValueNumericPostingAttribute< EnumAttribute<FloatingPointAttributeTemplate<float> >, - IEnumStore::AtomicIndex> - FloatArrayPostingListAttribute; - typedef MultiValueNumericPostingAttribute< + IEnumStore::AtomicIndex>; + using FloatWsetPostingListAttribute = MultiValueNumericPostingAttribute< EnumAttribute<FloatingPointAttributeTemplate<float> >, - multivalue::WeightedValue<IEnumStore::AtomicIndex> > - FloatWsetPostingListAttribute; + multivalue::WeightedValue<IEnumStore::AtomicIndex> >; - typedef SingleValueStringPostingAttribute StringPostingListAttribute; - typedef ArrayStringPostingAttribute StringArrayPostingListAttribute; - typedef WeightedSetStringPostingAttribute StringWsetPostingListAttribute; + using StringPostingListAttribute = SingleValueStringPostingAttribute; + using StringArrayPostingListAttribute = ArrayStringPostingAttribute; + using StringWsetPostingListAttribute = WeightedSetStringPostingAttribute; template <typename VectorType> void populate(VectorType &v); @@ -737,7 +731,7 @@ PostingListAttributeTest::testArithmeticValueUpdate(const AttributePtr & ptr) { LOG(info, "testArithmeticValueUpdate: vector '%s'", ptr->getName().c_str()); - typedef document::ArithmeticValueUpdate Arith; + using Arith = document::ArithmeticValueUpdate; AttributeType & vec = static_cast<AttributeType &>(*ptr.get()); addDocs(ptr, 4); diff --git a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp index 6df60f2ac4c..41216b750d1 100644 --- a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp @@ -264,14 +264,14 @@ bool search(const string &term, IAttributeManager &attribute_manager, } template <typename T> struct AttributeVectorTypeFinder { - typedef search::SingleValueStringAttribute Type; + using Type = search::SingleValueStringAttribute; static void add(Type & a, const T & v) { a.update(a.getNumDocs()-1, v); a.commit(); } }; template <> struct AttributeVectorTypeFinder<int64_t> { - typedef search::SingleValueNumericAttribute<search::IntegerAttributeTemplate<int64_t> > Type; + using Type = search::SingleValueNumericAttribute<search::IntegerAttributeTemplate<int64_t> >; static void add(Type & a, int64_t v) { a.set(a.getNumDocs()-1, v); a.commit(); } }; @@ -288,8 +288,8 @@ void add_docs(AttributeVector *attr, size_t n) { template <typename T> MyAttributeManager makeAttributeManager(T value) { - typedef AttributeVectorTypeFinder<T> AT; - typedef typename AT::Type AttributeVectorType; + using AT = AttributeVectorTypeFinder<T>; + using AttributeVectorType = typename AT::Type; AttributeVectorType *attr = new AttributeVectorType(field); add_docs(attr, num_docs); AT::add(*attr, value); diff --git a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp index 54db8feee93..40d4b20aaf2 100644 --- a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp +++ b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp @@ -127,7 +127,7 @@ public: template <typename V, typename T> static SearchContextPtr getSearch(const V & vec, const T & term, TermType termType=TermType::WORD); private: - typedef std::map<vespalib::string, Config> ConfigMap; + using ConfigMap = std::map<vespalib::string, Config>; // Map of all config objects ConfigMap _integerCfg; ConfigMap _floatCfg; diff --git a/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp b/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp index 2289000a273..4bcba209c13 100644 --- a/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp +++ b/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp @@ -20,12 +20,12 @@ using search::attribute::StringSearchHelper; using vespalib::datastore::EntryRef; using namespace search; -typedef ArrayStringAttribute ArrayStr; -typedef WeightedSetStringAttribute WeightedSetStr; -typedef ArrayStringPostingAttribute ArrayStrPosting; -typedef WeightedSetStringPostingAttribute WeightedSetStrPosting; -typedef attribute::Config Config; -typedef attribute::BasicType BasicType; +using ArrayStr = ArrayStringAttribute; +using WeightedSetStr = WeightedSetStringAttribute; +using ArrayStrPosting = ArrayStringPostingAttribute; +using WeightedSetStrPosting = WeightedSetStringPostingAttribute; +using Config = attribute::Config; +using BasicType = attribute::BasicType; template <typename Attribute> void diff --git a/searchlib/src/tests/bitvector/bitvectorbenchmark.cpp b/searchlib/src/tests/bitvector/bitvectorbenchmark.cpp index 26b0ccff656..266241adf59 100644 --- a/searchlib/src/tests/bitvector/bitvectorbenchmark.cpp +++ b/searchlib/src/tests/bitvector/bitvectorbenchmark.cpp @@ -152,7 +152,7 @@ BitVectorBenchmark::testCountSpeed3() void BitVectorBenchmark::testOrSpeed2() { - typedef uint64_t T; + using T = uint64_t; T * a = reinterpret_cast<T *>(_bv[0]->getStart()); const T * b = reinterpret_cast<const T *>(_bv[1]->getStart()); size_t sz = _bv[0]->size()/(8*sizeof(*a)); diff --git a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp index b3d8e46cb3a..272d74cde2c 100644 --- a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp +++ b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp @@ -184,9 +184,9 @@ assert_interleaved_features(DiskIndex &d, const vespalib::string &field, const v void validateDiskIndex(DiskIndex &dw, bool f2HasElements, bool f3HasWeights) { - typedef DiskIndex::LookupResult LR; - typedef index::PostingListHandle PH; - typedef search::queryeval::SearchIterator SB; + using LR = DiskIndex::LookupResult; + using PH = index::PostingListHandle; + using SB = search::queryeval::SearchIterator; const Schema &schema(dw.getSchema()); @@ -385,7 +385,7 @@ FusionTest::requireThatFusionIsWorking(const vespalib::string &prefix, bool dire ib.close(); vespalib::string tsName = dump2dir + "/.teststamp"; - typedef search::FileKit FileKit; + using FileKit = search::FileKit; ASSERT_TRUE(FileKit::createStamp(tsName)); ASSERT_TRUE(FileKit::hasStamp(tsName)); ASSERT_TRUE(FileKit::removeStamp(tsName)); diff --git a/searchlib/src/tests/features/beta/beta_features.cpp b/searchlib/src/tests/features/beta/beta_features.cpp index f3a134f39e3..f31b27c58fa 100644 --- a/searchlib/src/tests/features/beta/beta_features.cpp +++ b/searchlib/src/tests/features/beta/beta_features.cpp @@ -42,7 +42,7 @@ using CollectionType = FieldInfo::CollectionType; //--------------------------------------------------------------------------------------------------------------------- // TermPositionList //--------------------------------------------------------------------------------------------------------------------- -typedef std::pair<uint32_t, uint32_t> TermPosition; +using TermPosition = std::pair<uint32_t, uint32_t>; class TermPositionList : public std::vector<TermPosition> { public: TermPositionList &add(uint32_t termId, uint32_t pos) { diff --git a/searchlib/src/tests/features/euclidean_distance/euclidean_distance_test.cpp b/searchlib/src/tests/features/euclidean_distance/euclidean_distance_test.cpp index eed59fdde5e..1a9a602020c 100644 --- a/searchlib/src/tests/features/euclidean_distance/euclidean_distance_test.cpp +++ b/searchlib/src/tests/features/euclidean_distance/euclidean_distance_test.cpp @@ -21,11 +21,11 @@ using search::AttributeFactory; using search::IntegerAttribute; using search::FloatingPointAttribute; -typedef search::attribute::Config AVC; -typedef search::attribute::BasicType AVBT; -typedef search::attribute::CollectionType AVCT; -typedef search::AttributeVector::SP AttributePtr; -typedef FtTestApp FTA; +using AVC = search::attribute::Config; +using AVBT = search::attribute::BasicType; +using AVCT = search::attribute::CollectionType; +using AttributePtr = search::AttributeVector::SP; +using FTA = FtTestApp; using CollectionType = FieldInfo::CollectionType; struct SetupFixture diff --git a/searchlib/src/tests/features/featurebenchmark.cpp b/searchlib/src/tests/features/featurebenchmark.cpp index a3188ce21fa..5f4255d4cb4 100644 --- a/searchlib/src/tests/features/featurebenchmark.cpp +++ b/searchlib/src/tests/features/featurebenchmark.cpp @@ -29,21 +29,21 @@ using search::AttributeFactory; using search::IntegerAttribute; using search::StringAttribute; -typedef search::attribute::Config AVC; -typedef search::attribute::BasicType AVBT; -typedef search::attribute::CollectionType AVCT; +using AVC = search::attribute::Config; +using AVBT = search::attribute::BasicType; +using AVCT = search::attribute::CollectionType; -typedef AttributeVector::SP AttributePtr; +using AttributePtr = AttributeVector::SP; using CollectionType = FieldInfo::CollectionType; class Benchmark : public FtTestApp { public: - typedef std::vector<std::pair<vespalib::string, vespalib::string> > KeyValueVector; + using KeyValueVector = std::vector<std::pair<vespalib::string, vespalib::string> >; class Config { private: - typedef std::map<vespalib::string, vespalib::string> StringMap; + using StringMap = std::map<vespalib::string, vespalib::string>; StringMap _config; bool isKnown(const vespalib::string & key) const; diff --git a/searchlib/src/tests/features/internal_max_reduce_prod_join_feature/internal_max_reduce_prod_join_feature_test.cpp b/searchlib/src/tests/features/internal_max_reduce_prod_join_feature/internal_max_reduce_prod_join_feature_test.cpp index 532f646ae4d..4067d5b6125 100644 --- a/searchlib/src/tests/features/internal_max_reduce_prod_join_feature/internal_max_reduce_prod_join_feature_test.cpp +++ b/searchlib/src/tests/features/internal_max_reduce_prod_join_feature/internal_max_reduce_prod_join_feature_test.cpp @@ -18,11 +18,11 @@ using search::FloatingPointAttribute; using CollectionType = FieldInfo::CollectionType; using DataType = FieldInfo::DataType; -typedef search::attribute::Config AVC; -typedef search::attribute::BasicType AVBT; -typedef search::attribute::CollectionType AVCT; -typedef search::AttributeVector::SP AttributePtr; -typedef FtTestApp FTA; +using AVC = search::attribute::Config; +using AVBT = search::attribute::BasicType; +using AVCT = search::attribute::CollectionType; +using AttributePtr = search::AttributeVector::SP; +using FTA = FtTestApp; struct SetupFixture { diff --git a/searchlib/src/tests/features/prod_features.cpp b/searchlib/src/tests/features/prod_features.cpp index 73b66f36172..03563196379 100644 --- a/searchlib/src/tests/features/prod_features.cpp +++ b/searchlib/src/tests/features/prod_features.cpp @@ -2037,7 +2037,7 @@ Test::testRankingExpression() vespalib::string Test::getExpression(const vespalib::string ¶meter) const { - typedef search::fef::FeatureNameBuilder FNB; + using FNB = search::fef::FeatureNameBuilder; return FNB().baseName("rankingExpression").parameter(parameter).buildName(); } @@ -2148,7 +2148,7 @@ Test::testTermDistance() } { // test executor - typedef TermDistanceCalculator::Result Result; + using Result = TermDistanceCalculator::Result; const uint32_t UV = TermDistanceCalculator::UNDEFINED_VALUE; EXPECT_TRUE(assertTermDistance(Result(), "a b", "x x")); diff --git a/searchlib/src/tests/features/tensor_from_labels/tensor_from_labels_test.cpp b/searchlib/src/tests/features/tensor_from_labels/tensor_from_labels_test.cpp index b2143bacfd9..3eb5306277d 100644 --- a/searchlib/src/tests/features/tensor_from_labels/tensor_from_labels_test.cpp +++ b/searchlib/src/tests/features/tensor_from_labels/tensor_from_labels_test.cpp @@ -29,11 +29,11 @@ using vespalib::eval::Function; using vespalib::eval::TensorSpec; using vespalib::eval::SimpleValue; -typedef search::attribute::Config AVC; -typedef search::attribute::BasicType AVBT; -typedef search::attribute::CollectionType AVCT; -typedef search::AttributeVector::SP AttributePtr; -typedef FtTestApp FTA; +using AVC = search::attribute::Config; +using AVBT = search::attribute::BasicType; +using AVCT = search::attribute::CollectionType; +using AttributePtr = search::AttributeVector::SP; +using FTA = FtTestApp; Value::UP make_tensor(const TensorSpec &spec) { return SimpleValue::from_spec(spec); diff --git a/searchlib/src/tests/features/tensor_from_weighted_set/tensor_from_weighted_set_test.cpp b/searchlib/src/tests/features/tensor_from_weighted_set/tensor_from_weighted_set_test.cpp index e832812a2e1..4e3a289592f 100644 --- a/searchlib/src/tests/features/tensor_from_weighted_set/tensor_from_weighted_set_test.cpp +++ b/searchlib/src/tests/features/tensor_from_weighted_set/tensor_from_weighted_set_test.cpp @@ -29,11 +29,11 @@ using vespalib::eval::Function; using vespalib::eval::TensorSpec; using vespalib::eval::SimpleValue; -typedef search::attribute::Config AVC; -typedef search::attribute::BasicType AVBT; -typedef search::attribute::CollectionType AVCT; -typedef search::AttributeVector::SP AttributePtr; -typedef FtTestApp FTA; +using AVC = search::attribute::Config; +using AVBT = search::attribute::BasicType; +using AVCT = search::attribute::CollectionType; +using AttributePtr = search::AttributeVector::SP; +using FTA = FtTestApp; Value::UP make_tensor(const TensorSpec &spec) { return SimpleValue::from_spec(spec); diff --git a/searchlib/src/tests/fef/attributecontent/attributecontent_test.cpp b/searchlib/src/tests/fef/attributecontent/attributecontent_test.cpp index 08ae2701eb9..af4ea97808d 100644 --- a/searchlib/src/tests/fef/attributecontent/attributecontent_test.cpp +++ b/searchlib/src/tests/fef/attributecontent/attributecontent_test.cpp @@ -25,7 +25,7 @@ public: void Test::testWriteAndRead() { - typedef search::attribute::AttributeContent<uint32_t> UintContent; + using UintContent = search::attribute::AttributeContent<uint32_t>; UintContent buf; EXPECT_EQUAL(buf.capacity(), 16u); EXPECT_EQUAL(buf.size(), 0u); diff --git a/searchlib/src/tests/fef/featurenamebuilder/featurenamebuilder_test.cpp b/searchlib/src/tests/fef/featurenamebuilder/featurenamebuilder_test.cpp index f52881fa327..0738c1b4a37 100644 --- a/searchlib/src/tests/fef/featurenamebuilder/featurenamebuilder_test.cpp +++ b/searchlib/src/tests/fef/featurenamebuilder/featurenamebuilder_test.cpp @@ -6,7 +6,7 @@ LOG_SETUP("featurenamebuilder_test"); using namespace search::fef; -typedef FeatureNameBuilder B; +using B = FeatureNameBuilder; TEST_SETUP(Test); diff --git a/searchlib/src/tests/fef/featureoverride/featureoverride.cpp b/searchlib/src/tests/fef/featureoverride/featureoverride.cpp index b95478072de..90ee5519cc4 100644 --- a/searchlib/src/tests/fef/featureoverride/featureoverride.cpp +++ b/searchlib/src/tests/fef/featureoverride/featureoverride.cpp @@ -25,7 +25,7 @@ using vespalib::eval::FastValueBuilderFactory; using vespalib::make_string_short::fmt; -typedef Blueprint::SP BPSP; +using BPSP = Blueprint::SP; struct Fixture { diff --git a/searchlib/src/tests/fef/parameter/parameter_test.cpp b/searchlib/src/tests/fef/parameter/parameter_test.cpp index 6bce9fec8ff..2aa6d213fa5 100644 --- a/searchlib/src/tests/fef/parameter/parameter_test.cpp +++ b/searchlib/src/tests/fef/parameter/parameter_test.cpp @@ -21,11 +21,11 @@ public: class ParameterTest : public vespalib::TestApp { private: - typedef ParameterDescriptions PDS; - typedef ParameterType PT; - typedef Parameter P; - typedef StringList SL; - typedef ParameterValidator::Result PVR; + using PDS = ParameterDescriptions; + using PT = ParameterType; + using P = Parameter; + using SL = StringList; + using PVR = ParameterValidator::Result; bool assertParameter(const Parameter & exp, const Parameter & act); bool validate(const IIndexEnvironment & env, diff --git a/searchlib/src/tests/fef/termfieldmodel/termfieldmodel_test.cpp b/searchlib/src/tests/fef/termfieldmodel/termfieldmodel_test.cpp index f42ff600f78..54a7d6ea286 100644 --- a/searchlib/src/tests/fef/termfieldmodel/termfieldmodel_test.cpp +++ b/searchlib/src/tests/fef/termfieldmodel/termfieldmodel_test.cpp @@ -43,8 +43,8 @@ void testSetup(State &state) { state.term.addField(7); // docfreq = 2 state.term.addField(5); // docfreq = 3 - typedef search::fef::ITermFieldRangeAdapter FRA; - typedef search::fef::SimpleTermFieldRangeAdapter SFR; + using FRA = search::fef::ITermFieldRangeAdapter; + using SFR = search::fef::SimpleTermFieldRangeAdapter; // lookup terms { diff --git a/searchlib/src/tests/fef/termmatchdatamerger/termmatchdatamerger_test.cpp b/searchlib/src/tests/fef/termmatchdatamerger/termmatchdatamerger_test.cpp index 4618a29cf49..58389f8f1a8 100644 --- a/searchlib/src/tests/fef/termmatchdatamerger/termmatchdatamerger_test.cpp +++ b/searchlib/src/tests/fef/termmatchdatamerger/termmatchdatamerger_test.cpp @@ -6,8 +6,8 @@ using namespace search::fef; -typedef TermMatchDataMerger::Input MDMI; -typedef TermMatchDataMerger::Inputs MDMIs; +using MDMI = TermMatchDataMerger::Input; +using MDMIs = TermMatchDataMerger::Inputs; namespace { diff --git a/searchlib/src/tests/grouping/grouping_test.cpp b/searchlib/src/tests/grouping/grouping_test.cpp index 2eab66cb3b7..adf4320ede3 100644 --- a/searchlib/src/tests/grouping/grouping_test.cpp +++ b/searchlib/src/tests/grouping/grouping_test.cpp @@ -83,9 +83,9 @@ public: } }; -typedef AttrBuilder<SingleIntegerExtAttribute, int64_t> IntAttrBuilder; -typedef AttrBuilder<SingleFloatExtAttribute, double> FloatAttrBuilder; -typedef AttrBuilder<SingleStringExtAttribute, const char *> StringAttrBuilder; +using IntAttrBuilder = AttrBuilder<SingleIntegerExtAttribute, int64_t>; +using FloatAttrBuilder = AttrBuilder<SingleFloatExtAttribute, double>; +using StringAttrBuilder = AttrBuilder<SingleStringExtAttribute, const char *>; using StringArrayAttrBuilder = AttrBuilder<MultiStringExtAttribute, const char *>; using IntArrayAttrBuilder = AttrBuilder<MultiIntegerExtAttribute, int64_t>; @@ -1825,10 +1825,10 @@ Test::checkBucket(const NumericResultNode &width, const NumericResultNode &value void Test::testFixedWidthBuckets() { - typedef Int64ResultNode Int; - typedef FloatResultNode Float; - typedef IntegerBucketResultNode IntBucket; - typedef FloatBucketResultNode FloatBucket; + using Int = Int64ResultNode; + using Float = FloatResultNode; + using IntBucket = IntegerBucketResultNode; + using FloatBucket = FloatBucketResultNode; // positive int buckets EXPECT_TRUE(checkBucket(Int(10), Int(0), IntBucket(0,10))); diff --git a/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp b/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp index e82079073e7..cd2f4a58552 100644 --- a/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp +++ b/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp @@ -69,9 +69,9 @@ public: } }; -typedef AttrBuilder<SingleIntegerExtAttribute, int64_t> IntAttrBuilder; -typedef AttrBuilder<SingleFloatExtAttribute, double> FloatAttrBuilder; -typedef AttrBuilder<SingleStringExtAttribute, const char *> StringAttrBuilder; +using IntAttrBuilder = AttrBuilder<SingleIntegerExtAttribute, int64_t>; +using FloatAttrBuilder = AttrBuilder<SingleFloatExtAttribute, double>; +using StringAttrBuilder = AttrBuilder<SingleStringExtAttribute, const char *>; //----------------------------------------------------------------------------- diff --git a/searchlib/src/tests/groupingengine/groupingengine_test.cpp b/searchlib/src/tests/groupingengine/groupingengine_test.cpp index d54b68388e4..6e5a7e895dd 100644 --- a/searchlib/src/tests/groupingengine/groupingengine_test.cpp +++ b/searchlib/src/tests/groupingengine/groupingengine_test.cpp @@ -68,9 +68,9 @@ public: } }; -typedef AttrBuilder<SingleIntegerExtAttribute, int64_t> IntAttrBuilder; -typedef AttrBuilder<SingleFloatExtAttribute, double> FloatAttrBuilder; -typedef AttrBuilder<SingleStringExtAttribute, const char *> StringAttrBuilder; +using IntAttrBuilder = AttrBuilder<SingleIntegerExtAttribute, int64_t>; +using FloatAttrBuilder = AttrBuilder<SingleFloatExtAttribute, double>; +using StringAttrBuilder = AttrBuilder<SingleStringExtAttribute, const char *>; //----------------------------------------------------------------------------- @@ -1823,10 +1823,10 @@ Test::checkBucket(const NumericResultNode &width, const NumericResultNode &value void Test::testFixedWidthBuckets() { - typedef Int64ResultNode Int; - typedef FloatResultNode Float; - typedef IntegerBucketResultNode IntBucket; - typedef FloatBucketResultNode FloatBucket; + using Int = Int64ResultNode; + using Float = FloatResultNode; + using IntBucket = IntegerBucketResultNode; + using FloatBucket = FloatBucketResultNode; // positive int buckets EXPECT_TRUE(checkBucket(Int(10), Int(0), IntBucket(0,10))); diff --git a/searchlib/src/tests/hitcollector/hitcollector_test.cpp b/searchlib/src/tests/hitcollector/hitcollector_test.cpp index f02fdbea3bc..b4c015070db 100644 --- a/searchlib/src/tests/hitcollector/hitcollector_test.cpp +++ b/searchlib/src/tests/hitcollector/hitcollector_test.cpp @@ -12,7 +12,7 @@ using namespace search; using namespace search::fef; using namespace search::queryeval; -typedef std::map<uint32_t, feature_t> ScoreMap; +using ScoreMap = std::map<uint32_t, feature_t>; using Ranges = std::pair<Scores, Scores>; diff --git a/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp b/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp index 93ad6c75a1b..256ef80343f 100644 --- a/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp +++ b/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp @@ -6,7 +6,7 @@ using search::IndexMetaInfo; -typedef IndexMetaInfo::Snapshot Snap; +using Snap = IndexMetaInfo::Snapshot; TEST_SETUP(Test) diff --git a/searchlib/src/tests/predicate/predicate_tree_analyzer_test.cpp b/searchlib/src/tests/predicate/predicate_tree_analyzer_test.cpp index b004c2c5c42..e8508b0292a 100644 --- a/searchlib/src/tests/predicate/predicate_tree_analyzer_test.cpp +++ b/searchlib/src/tests/predicate/predicate_tree_analyzer_test.cpp @@ -19,7 +19,7 @@ using std::map; using std::string; namespace { -typedef PredicateSlimeBuilder Builder; +using Builder = PredicateSlimeBuilder; TEST("require that minfeature is 1 for simple term") { auto slime(Builder().feature("foo").value("bar").build()); diff --git a/searchlib/src/tests/query/customtypevisitor_test.cpp b/searchlib/src/tests/query/customtypevisitor_test.cpp index b1e979b5bcb..86288fda498 100644 --- a/searchlib/src/tests/query/customtypevisitor_test.cpp +++ b/searchlib/src/tests/query/customtypevisitor_test.cpp @@ -50,32 +50,32 @@ struct MyTrue : TrueQueryNode {}; struct MyFalse : FalseQueryNode {}; struct MyQueryNodeTypes { - typedef MyAnd And; - typedef MyAndNot AndNot; - typedef MyEquiv Equiv; - typedef MyNumberTerm NumberTerm; - typedef MyLocationTerm LocationTerm; - typedef MyNear Near; - typedef MyONear ONear; - typedef MyOr Or; - typedef MyPhrase Phrase; - typedef MySameElement SameElement; - typedef MyPrefixTerm PrefixTerm; - typedef MyRangeTerm RangeTerm; - typedef MyRank Rank; - typedef MyStringTerm StringTerm; - typedef MySubstrTerm SubstringTerm; - typedef MySuffixTerm SuffixTerm; - typedef MyFuzzyTerm FuzzyTerm; - typedef MyWeakAnd WeakAnd; - typedef MyWeightedSetTerm WeightedSetTerm; - typedef MyDotProduct DotProduct; - typedef MyWandTerm WandTerm; - typedef MyPredicateQuery PredicateQuery; - typedef MyRegExpTerm RegExpTerm; - typedef MyNearestNeighborTerm NearestNeighborTerm; - typedef MyFalse FalseQueryNode; - typedef MyTrue TrueQueryNode; + using And = MyAnd; + using AndNot = MyAndNot; + using Equiv = MyEquiv; + using NumberTerm = MyNumberTerm; + using LocationTerm = MyLocationTerm; + using Near = MyNear; + using ONear = MyONear; + using Or = MyOr; + using Phrase = MyPhrase; + using SameElement = MySameElement; + using PrefixTerm = MyPrefixTerm; + using RangeTerm = MyRangeTerm; + using Rank = MyRank; + using StringTerm = MyStringTerm; + using SubstringTerm = MySubstrTerm; + using SuffixTerm = MySuffixTerm; + using FuzzyTerm = MyFuzzyTerm; + using WeakAnd = MyWeakAnd; + using WeightedSetTerm = MyWeightedSetTerm; + using DotProduct = MyDotProduct; + using WandTerm = MyWandTerm; + using PredicateQuery = MyPredicateQuery; + using RegExpTerm = MyRegExpTerm; + using NearestNeighborTerm = MyNearestNeighborTerm; + using FalseQueryNode = MyFalse; + using TrueQueryNode = MyTrue; }; class MyCustomVisitor : public CustomTypeVisitor<MyQueryNodeTypes> diff --git a/searchlib/src/tests/query/querybuilder_test.cpp b/searchlib/src/tests/query/querybuilder_test.cpp index aad632fdb70..32285918826 100644 --- a/searchlib/src/tests/query/querybuilder_test.cpp +++ b/searchlib/src/tests/query/querybuilder_test.cpp @@ -174,31 +174,28 @@ as_node(Node* node) template <class NodeTypes> void checkQueryTreeTypes(Node *node) { - typedef typename NodeTypes::And And; - typedef typename NodeTypes::AndNot AndNot; - typedef typename NodeTypes::NumberTerm NumberTerm; - //typedef typename NodeTypes::NumberTerm FloatTrm; - typedef typename NodeTypes::Near Near; - typedef typename NodeTypes::ONear ONear; - typedef typename NodeTypes::SameElement SameElement; - typedef typename NodeTypes::Or Or; - typedef typename NodeTypes::Phrase Phrase; - typedef typename NodeTypes::PrefixTerm PrefixTerm; - typedef typename NodeTypes::RangeTerm RangeTerm; - typedef typename NodeTypes::Rank Rank; - typedef typename NodeTypes::StringTerm StringTerm; - //typedef typename NodeTypes::SubstringTerm SubstrTr; - typedef typename NodeTypes::SuffixTerm SuffixTerm; - typedef typename NodeTypes::LocationTerm LocationTerm; - //typedef typename NodeTypes::WeightedSetTerm WeightedSetTerm; - typedef typename NodeTypes::DotProduct DotProduct; - typedef typename NodeTypes::WandTerm WandTerm; - typedef typename NodeTypes::WeakAnd WeakAnd; - typedef typename NodeTypes::PredicateQuery PredicateQuery; - typedef typename NodeTypes::RegExpTerm RegExpTerm; - typedef typename NodeTypes::TrueQueryNode TrueNode; - typedef typename NodeTypes::FalseQueryNode FalseNode; - typedef typename NodeTypes::FuzzyTerm FuzzyTerm; + using And = typename NodeTypes::And; + using AndNot = typename NodeTypes::AndNot; + using NumberTerm = typename NodeTypes::NumberTerm; + using Near = typename NodeTypes::Near; + using ONear = typename NodeTypes::ONear; + using SameElement = typename NodeTypes::SameElement; + using Or = typename NodeTypes::Or; + using Phrase = typename NodeTypes::Phrase; + using PrefixTerm = typename NodeTypes::PrefixTerm; + using RangeTerm = typename NodeTypes::RangeTerm; + using Rank = typename NodeTypes::Rank; + using StringTerm = typename NodeTypes::StringTerm; + using SuffixTerm = typename NodeTypes::SuffixTerm; + using LocationTerm = typename NodeTypes::LocationTerm; + using DotProduct = typename NodeTypes::DotProduct; + using WandTerm = typename NodeTypes::WandTerm; + using WeakAnd = typename NodeTypes::WeakAnd; + using PredicateQuery = typename NodeTypes::PredicateQuery; + using RegExpTerm = typename NodeTypes::RegExpTerm; + using TrueNode = typename NodeTypes::TrueQueryNode; + using FalseNode = typename NodeTypes::FalseQueryNode; + using FuzzyTerm = typename NodeTypes::FuzzyTerm; ASSERT_TRUE(node); auto* and_node = as_node<And>(node); @@ -334,30 +331,30 @@ void checkQueryTreeTypes(Node *node) { } struct AbstractTypes { - typedef search::query::And And; - typedef search::query::AndNot AndNot; - typedef search::query::NumberTerm NumberTerm; - typedef search::query::LocationTerm LocationTerm; - typedef search::query::Near Near; - typedef search::query::ONear ONear; - typedef search::query::SameElement SameElement; - typedef search::query::Or Or; - typedef search::query::Phrase Phrase; - typedef search::query::PrefixTerm PrefixTerm; - typedef search::query::RangeTerm RangeTerm; - typedef search::query::Rank Rank; - typedef search::query::StringTerm StringTerm; - typedef search::query::SubstringTerm SubstringTerm; - typedef search::query::SuffixTerm SuffixTerm; - typedef search::query::WeightedSetTerm WeightedSetTerm; - typedef search::query::DotProduct DotProduct; - typedef search::query::WandTerm WandTerm; - typedef search::query::WeakAnd WeakAnd; - typedef search::query::PredicateQuery PredicateQuery; - typedef search::query::RegExpTerm RegExpTerm; - typedef search::query::TrueQueryNode TrueQueryNode; - typedef search::query::FalseQueryNode FalseQueryNode; - typedef search::query::FuzzyTerm FuzzyTerm; + using And = search::query::And; + using AndNot = search::query::AndNot; + using NumberTerm = search::query::NumberTerm; + using LocationTerm = search::query::LocationTerm; + using Near = search::query::Near; + using ONear = search::query::ONear; + using SameElement = search::query::SameElement; + using Or = search::query::Or; + using Phrase = search::query::Phrase; + using PrefixTerm = search::query::PrefixTerm; + using RangeTerm = search::query::RangeTerm; + using Rank = search::query::Rank; + using StringTerm = search::query::StringTerm; + using SubstringTerm = search::query::SubstringTerm; + using SuffixTerm = search::query::SuffixTerm; + using WeightedSetTerm = search::query::WeightedSetTerm; + using DotProduct = search::query::DotProduct; + using WandTerm = search::query::WandTerm; + using WeakAnd = search::query::WeakAnd; + using PredicateQuery = search::query::PredicateQuery; + using RegExpTerm = search::query::RegExpTerm; + using TrueQueryNode = search::query::TrueQueryNode; + using FalseQueryNode = search::query::FalseQueryNode; + using FuzzyTerm = search::query::FuzzyTerm; }; // Builds a tree with simplequery and checks that the results have the @@ -461,32 +458,32 @@ struct MyFuzzyTerm : FuzzyTerm { }; struct MyQueryNodeTypes { - typedef MyAnd And; - typedef MyAndNot AndNot; - typedef MyEquiv Equiv; - typedef MyNumberTerm NumberTerm; - typedef MyLocationTerm LocationTerm; - typedef MyNear Near; - typedef MyONear ONear; - typedef MyOr Or; - typedef MyPhrase Phrase; - typedef MySameElement SameElement; - typedef MyPrefixTerm PrefixTerm; - typedef MyRangeTerm RangeTerm; - typedef MyRank Rank; - typedef MyStringTerm StringTerm; - typedef MySubstringTerm SubstringTerm; - typedef MySuffixTerm SuffixTerm; - typedef MyWeakAnd WeakAnd; - typedef MyWeightedSetTerm WeightedSetTerm; - typedef MyDotProduct DotProduct; - typedef MyWandTerm WandTerm; - typedef MyPredicateQuery PredicateQuery; - typedef MyRegExpTerm RegExpTerm; - typedef MyNearestNeighborTerm NearestNeighborTerm; - typedef MyTrue TrueQueryNode; - typedef MyFalse FalseQueryNode; - typedef MyFuzzyTerm FuzzyTerm; + using And = MyAnd; + using AndNot = MyAndNot; + using Equiv = MyEquiv; + using NumberTerm = MyNumberTerm; + using LocationTerm = MyLocationTerm; + using Near = MyNear; + using ONear = MyONear; + using Or = MyOr; + using Phrase = MyPhrase; + using SameElement = MySameElement; + using PrefixTerm = MyPrefixTerm; + using RangeTerm = MyRangeTerm; + using Rank = MyRank; + using StringTerm = MyStringTerm; + using SubstringTerm = MySubstringTerm; + using SuffixTerm = MySuffixTerm; + using WeakAnd = MyWeakAnd; + using WeightedSetTerm = MyWeightedSetTerm; + using DotProduct = MyDotProduct; + using WandTerm = MyWandTerm; + using PredicateQuery = MyPredicateQuery; + using RegExpTerm = MyRegExpTerm; + using NearestNeighborTerm = MyNearestNeighborTerm; + using TrueQueryNode = MyTrue; + using FalseQueryNode = MyFalse; + using FuzzyTerm = MyFuzzyTerm; }; TEST("require that Custom Query Trees Can Be Built") { diff --git a/searchlib/src/tests/queryeval/blueprint/mysearch.h b/searchlib/src/tests/queryeval/blueprint/mysearch.h index 23cfc8583cd..6c91a23e80b 100644 --- a/searchlib/src/tests/queryeval/blueprint/mysearch.h +++ b/searchlib/src/tests/queryeval/blueprint/mysearch.h @@ -12,8 +12,8 @@ namespace search::queryeval { class MySearch : public MultiSearch { public: - typedef search::fef::TermFieldMatchDataArray TFMDA; - typedef search::fef::MatchData MatchData; + using TFMDA = search::fef::TermFieldMatchDataArray; + using MatchData = search::fef::MatchData; private: vespalib::string _tag; @@ -103,7 +103,7 @@ public: class MyLeaf : public SimpleLeafBlueprint { - typedef search::fef::TermFieldMatchDataArray TFMDA; + using TFMDA = search::fef::TermFieldMatchDataArray; bool _got_global_filter; public: diff --git a/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp b/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp index b5d4ec71a3b..397014f498f 100644 --- a/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp +++ b/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp @@ -53,7 +53,7 @@ void Test::setup() } } -typedef std::vector<uint32_t> H; +using H = std::vector<uint32_t>; H seek(SearchIterator & s, uint32_t docIdLimit) diff --git a/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_test.cpp b/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_test.cpp index 01175608bc5..d0ccbaeb180 100644 --- a/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_test.cpp +++ b/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_test.cpp @@ -90,7 +90,7 @@ void Test::setup() } } -typedef std::vector<uint32_t> H; +using H = std::vector<uint32_t>; H seekNoReset(SearchIterator & s, uint32_t start, uint32_t docIdLimit) @@ -565,7 +565,7 @@ Test::testOptimizeAndOr(bool invert) void Test::testEndGuard(bool invert) { - typedef AndSearch T; + using T = AndSearch; TermFieldMatchData tfmd; MultiSearch::Children children; diff --git a/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp b/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp index 55ca42f7369..83ffae0524c 100644 --- a/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp +++ b/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp @@ -18,10 +18,10 @@ using namespace search::query; using namespace search::queryeval; using namespace search::queryeval::test; -typedef search::feature_t feature_t; -typedef wand::score_t score_t; -typedef ParallelWeakAndSearch::MatchParams MatchParams; -typedef ParallelWeakAndSearch::RankParams RankParams; +using feature_t = search::feature_t; +using score_t = wand::score_t; +using MatchParams = ParallelWeakAndSearch::MatchParams; +using RankParams = ParallelWeakAndSearch::RankParams; using search::test::DocumentWeightAttributeHelper; using search::IDocumentWeightAttribute; using search::fef::TermFieldMatchData; @@ -115,8 +115,8 @@ WandTestSpec<HeapType>::WandTestSpec(uint32_t scoresToTrack, uint32_t scoresAdju template <typename HeapType> WandTestSpec<HeapType>::~WandTestSpec() {} -typedef WandTestSpec<TestHeap> WandSpecWithTestHeap; -typedef WandTestSpec<SharedWeakAndPriorityQueue> WandSpecWithRealHeap; +using WandSpecWithTestHeap = WandTestSpec<TestHeap>; +using WandSpecWithRealHeap = WandTestSpec<SharedWeakAndPriorityQueue>; FakeResult doSearch(SearchIterator &sb, const TermFieldMatchData &tfmd) diff --git a/searchlib/src/tests/queryeval/predicate/predicate_search_test.cpp b/searchlib/src/tests/queryeval/predicate/predicate_search_test.cpp index 890c73ce17c..d15175ba5d1 100644 --- a/searchlib/src/tests/queryeval/predicate/predicate_search_test.cpp +++ b/searchlib/src/tests/queryeval/predicate/predicate_search_test.cpp @@ -85,9 +85,9 @@ make_posting_lists_vector(MyPostingList (&plists)[N]) { } TermFieldMatchDataArray tfmda; -typedef std::vector<uint8_t> CV; -typedef std::vector<uint8_t> MF; -typedef std::vector<uint16_t> IR; +using CV = std::vector<uint8_t>; +using MF = std::vector<uint8_t>; +using IR = std::vector<uint16_t>; TEST("Require that the skipping is efficient") { const uint8_t min_feature[] = { 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, diff --git a/searchlib/src/tests/queryeval/queryeval.cpp b/searchlib/src/tests/queryeval/queryeval.cpp index 5d34e491708..62815f285c4 100644 --- a/searchlib/src/tests/queryeval/queryeval.cpp +++ b/searchlib/src/tests/queryeval/queryeval.cpp @@ -605,7 +605,7 @@ TEST("testDump") { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wshadow" #endif - typedef SourceBlenderSearch::Child Source; + using Source = SourceBlenderSearch::Child; #ifdef __clang__ #pragma clang diagnostic pop #endif diff --git a/searchlib/src/tests/queryeval/sparse_vector_benchmark/sparse_vector_benchmark_test.cpp b/searchlib/src/tests/queryeval/sparse_vector_benchmark/sparse_vector_benchmark_test.cpp index df01744d619..ac7dabd786b 100644 --- a/searchlib/src/tests/queryeval/sparse_vector_benchmark/sparse_vector_benchmark_test.cpp +++ b/searchlib/src/tests/queryeval/sparse_vector_benchmark/sparse_vector_benchmark_test.cpp @@ -84,7 +84,7 @@ private: Writer _writer; public: - typedef std::unique_ptr<Graph> UP; + using UP = std::unique_ptr<Graph>; Graph(const std::string &file) : _writer(file) {} void addValue(double x, double y) { _writer.fmt("%g %g\n", x, y); } }; @@ -99,7 +99,7 @@ private: static int _plots; public: - typedef std::unique_ptr<Plot> UP; + using UP = std::unique_ptr<Plot>; Plot(const std::string &title) : _name(vespalib::make_string("plot.%d", _plots++)), _graphs(0), _writer(vespalib::make_string("%s.gnuplot", _name.c_str())) { diff --git a/searchlib/src/tests/queryeval/weak_and/rise_wand.h b/searchlib/src/tests/queryeval/weak_and/rise_wand.h index 7a5e46c05ea..250993bf139 100644 --- a/searchlib/src/tests/queryeval/weak_and/rise_wand.h +++ b/searchlib/src/tests/queryeval/weak_and/rise_wand.h @@ -28,10 +28,10 @@ template <typename Scorer, typename Cmp> class RiseWand : public search::queryeval::SearchIterator { public: - typedef uint32_t docid_t; - typedef uint64_t score_t; - typedef search::queryeval::wand::Terms Terms; - typedef search::queryeval::SearchIterator *PostingStreamPtr; + using docid_t = uint32_t; + using score_t = uint64_t; + using Terms = search::queryeval::wand::Terms; + using PostingStreamPtr = search::queryeval::SearchIterator*; private: // comparator class that compares two streams. The variables a and b are @@ -125,8 +125,8 @@ public: void doUnpack(uint32_t docid) override; }; -typedef RiseWand<TermFreqScorer, std::greater_equal<uint64_t> > TermFrequencyRiseWand; -typedef RiseWand<DotProductScorer, std::greater<uint64_t> > DotProductRiseWand; +using TermFrequencyRiseWand = RiseWand<TermFreqScorer, std::greater_equal<uint64_t> >; +using DotProductRiseWand = RiseWand<DotProductScorer, std::greater<uint64_t> >; } // namespacve rise diff --git a/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp b/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp index 87eec226221..fd73243b4fa 100644 --- a/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp +++ b/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp @@ -18,8 +18,8 @@ using namespace search::fef; using namespace search::queryeval; using namespace vespalib; -typedef ParallelWeakAndSearch::MatchParams PWMatchParams; -typedef ParallelWeakAndSearch::RankParams PWRankParams; +using PWMatchParams = ParallelWeakAndSearch::MatchParams; +using PWRankParams = ParallelWeakAndSearch::RankParams; namespace { diff --git a/searchlib/src/tests/queryeval/weak_and/weak_and_test.cpp b/searchlib/src/tests/queryeval/weak_and/weak_and_test.cpp index 828538b5e8e..e1593f7ad1d 100644 --- a/searchlib/src/tests/queryeval/weak_and/weak_and_test.cpp +++ b/searchlib/src/tests/queryeval/weak_and/weak_and_test.cpp @@ -13,7 +13,7 @@ using namespace search::fef; using namespace search::queryeval; using namespace search::queryeval::test; -typedef SearchHistory History; +using History = SearchHistory; namespace { diff --git a/searchlib/src/tests/queryeval/weak_and_heap/weak_and_heap_test.cpp b/searchlib/src/tests/queryeval/weak_and_heap/weak_and_heap_test.cpp index 42d40367b03..1304168b179 100644 --- a/searchlib/src/tests/queryeval/weak_and_heap/weak_and_heap_test.cpp +++ b/searchlib/src/tests/queryeval/weak_and_heap/weak_and_heap_test.cpp @@ -3,7 +3,7 @@ #include <vespa/searchlib/queryeval/wand/weak_and_heap.h> using namespace search::queryeval; -typedef wand::score_t score_t; +using score_t = wand::score_t; struct Scores : public std::vector<score_t> { Scores &s(score_t val) { diff --git a/searchlib/src/tests/queryeval/weak_and_scorers/weak_and_scorers_test.cpp b/searchlib/src/tests/queryeval/weak_and_scorers/weak_and_scorers_test.cpp index d94fd12e532..c5c0ea9a528 100644 --- a/searchlib/src/tests/queryeval/weak_and_scorers/weak_and_scorers_test.cpp +++ b/searchlib/src/tests/queryeval/weak_and_scorers/weak_and_scorers_test.cpp @@ -8,7 +8,7 @@ using namespace search::queryeval; using search::fef::TermFieldMatchData; using search::fef::TermFieldMatchDataPosition; -typedef wand::Term Term; +using Term = wand::Term; struct TestIterator : public SearchIterator { @@ -18,7 +18,7 @@ struct TestIterator : public SearchIterator TermFieldMatchData _tfmd; uint32_t _unpackDocId; - typedef std::unique_ptr<TestIterator> UP; + using UP = std::unique_ptr<TestIterator>; TestIterator(int32_t maxWeight, int32_t termWeight, bool useInfo) : _info(0, maxWeight), _termWeight(termWeight), diff --git a/searchlib/src/tests/ranksetup/ranksetup_test.cpp b/searchlib/src/tests/ranksetup/ranksetup_test.cpp index 63209446746..50d9d36f575 100644 --- a/searchlib/src/tests/ranksetup/ranksetup_test.cpp +++ b/searchlib/src/tests/ranksetup/ranksetup_test.cpp @@ -43,7 +43,7 @@ using namespace search::fef::test; using search::feature_t; using vespalib::make_string_short::fmt; -typedef FeatureNameBuilder FNB; +using FNB = FeatureNameBuilder; //----------------------------------------------------------------------------- // DumpFeatureVisitor @@ -785,7 +785,7 @@ RankSetupTest::testFeatureDump() void RankSetupTest::checkFeatures(std::map<vespalib::string, feature_t> &exp, std::map<vespalib::string, feature_t> &actual) { - typedef std::map<vespalib::string, feature_t>::const_iterator ITR; + using ITR = std::map<vespalib::string, feature_t>::const_iterator; if (!EXPECT_EQUAL(exp.size(), actual.size())) { return; } diff --git a/searchlib/src/tests/sort/sortbenchmark.cpp b/searchlib/src/tests/sort/sortbenchmark.cpp index 59d5f16d980..04832593b28 100644 --- a/searchlib/src/tests/sort/sortbenchmark.cpp +++ b/searchlib/src/tests/sort/sortbenchmark.cpp @@ -11,7 +11,7 @@ using vespalib::ConstBufferRef; class Test : public vespalib::TestApp { public: - typedef std::vector<uint32_t> V; + using V = std::vector<uint32_t>; std::vector< std::vector<uint32_t> > _data; int Main() override; void generateVectors(size_t numVectors, size_t values); diff --git a/searchlib/src/tests/sortspec/multilevelsort.cpp b/searchlib/src/tests/sortspec/multilevelsort.cpp index 87dc6608c3f..ec14f0c97e1 100644 --- a/searchlib/src/tests/sortspec/multilevelsort.cpp +++ b/searchlib/src/tests/sortspec/multilevelsort.cpp @@ -16,10 +16,10 @@ LOG_SETUP("multilevelsort_test"); using namespace search; -typedef FloatingPointAttributeTemplate<float> Float; -typedef FloatingPointAttributeTemplate<double> Double; -typedef std::map<std::string, AttributeVector::SP > VectorMap; -typedef AttributeVector::SP AttributePtr; +using Float = FloatingPointAttributeTemplate<float>; +using Double = FloatingPointAttributeTemplate<double>; +using VectorMap = std::map<std::string, AttributeVector::SP >; +using AttributePtr = AttributeVector::SP; using search::attribute::Config; using search::attribute::BasicType; using search::attribute::CollectionType; diff --git a/searchlib/src/tests/transactionlog/translogclient_test.cpp b/searchlib/src/tests/transactionlog/translogclient_test.cpp index 1eae8489c75..af214c34be8 100644 --- a/searchlib/src/tests/transactionlog/translogclient_test.cpp +++ b/searchlib/src/tests/transactionlog/translogclient_test.cpp @@ -87,7 +87,7 @@ class CallBackTest : public Callback private: RPC::Result receive(const Packet & packet) override; void eof() override { _eof.set(); } - typedef std::map<SerialNum, std::unique_ptr<ByteBuffer>> PacketMap; + using PacketMap = std::map<SerialNum, std::unique_ptr<ByteBuffer>>; PacketMap _packetMap; Eof _eof; public: @@ -146,7 +146,7 @@ CallBackManyTest::receive(const Packet & p) class CallBackUpdate : public Callback { public: - typedef std::map<SerialNum, Identifiable *> PacketMap; + using PacketMap = std::map<SerialNum, Identifiable *>; private: RPC::Result receive(const Packet & packet) override; void eof() override { _eof.set(); } diff --git a/searchlib/src/vespa/searchcommon/attribute/attributecontent.h b/searchlib/src/vespa/searchcommon/attribute/attributecontent.h index f5960ce358b..696112450d5 100644 --- a/searchlib/src/vespa/searchcommon/attribute/attributecontent.h +++ b/searchlib/src/vespa/searchcommon/attribute/attributecontent.h @@ -152,15 +152,15 @@ public: } }; -typedef AttributeContent<double> FloatContent; -typedef AttributeContent<const char *> ConstCharContent; -typedef AttributeContent<IAttributeVector::largeint_t> IntegerContent; -typedef AttributeContent<IAttributeVector::EnumHandle> EnumContent; -typedef AttributeContent<IAttributeVector::WeightedInt> WeightedIntegerContent; -typedef AttributeContent<IAttributeVector::WeightedFloat> WeightedFloatContent; -typedef AttributeContent<IAttributeVector::WeightedConstChar> WeightedConstCharContent; -typedef AttributeContent<IAttributeVector::WeightedString> WeightedStringContent; -typedef AttributeContent<IAttributeVector::WeightedEnum> WeightedEnumContent; -typedef IAttributeVector::EnumHandle EnumHandle; +using FloatContent = AttributeContent<double>; +using ConstCharContent = AttributeContent<const char *>; +using IntegerContent = AttributeContent<IAttributeVector::largeint_t>; +using EnumContent = AttributeContent<IAttributeVector::EnumHandle>; +using WeightedIntegerContent = AttributeContent<IAttributeVector::WeightedInt>; +using WeightedFloatContent = AttributeContent<IAttributeVector::WeightedFloat>; +using WeightedConstCharContent = AttributeContent<IAttributeVector::WeightedConstChar>; +using WeightedStringContent = AttributeContent<IAttributeVector::WeightedString>; +using WeightedEnumContent = AttributeContent<IAttributeVector::WeightedEnum>; +using EnumHandle = IAttributeVector::EnumHandle; } diff --git a/searchlib/src/vespa/searchlib/aggregation/group.h b/searchlib/src/vespa/searchlib/aggregation/group.h index 53061b1447b..b4975dba3c5 100644 --- a/searchlib/src/vespa/searchlib/aggregation/group.h +++ b/searchlib/src/vespa/searchlib/aggregation/group.h @@ -36,8 +36,8 @@ public: using ResultNode = expression::ResultNode; using ExpressionNode = expression::ExpressionNode; using UP = std::unique_ptr<Group>; - typedef Group * ChildP; - typedef ChildP * GroupList; + using ChildP = Group *; + using GroupList = ChildP *; struct GroupEqual { GroupEqual(const GroupList * v) : _v(v) { } bool operator()(uint32_t a, uint32_t b) { return (*_v)[a]->getId().cmpFast((*_v)[b]->getId()) == 0; } diff --git a/searchlib/src/vespa/searchlib/aggregation/grouping.h b/searchlib/src/vespa/searchlib/aggregation/grouping.h index 824c52b2c2a..1c0ee0de85d 100644 --- a/searchlib/src/vespa/searchlib/aggregation/grouping.h +++ b/searchlib/src/vespa/searchlib/aggregation/grouping.h @@ -18,8 +18,8 @@ namespace search::aggregation { class Grouping : public vespalib::Identifiable { public: - typedef std::vector<GroupingLevel> GroupingLevelList; - typedef std::unique_ptr<Grouping> UP; + using GroupingLevelList = std::vector<GroupingLevel>; + using UP = std::unique_ptr<Grouping>; private: uint32_t _id; // client id for this grouping diff --git a/searchlib/src/vespa/searchlib/aggregation/hit.h b/searchlib/src/vespa/searchlib/aggregation/hit.h index b1625e7babc..93a09e2e76b 100644 --- a/searchlib/src/vespa/searchlib/aggregation/hit.h +++ b/searchlib/src/vespa/searchlib/aggregation/hit.h @@ -15,7 +15,7 @@ private: public: DECLARE_IDENTIFIABLE_ABSTRACT_NS2(search, aggregation, Hit); DECLARE_NBO_SERIALIZE; - typedef std::unique_ptr<Hit> UP; + using UP = std::unique_ptr<Hit>; Hit() : _rank() {} Hit(RawRank rank) : _rank(rank) {} diff --git a/searchlib/src/vespa/searchlib/aggregation/hitlist.h b/searchlib/src/vespa/searchlib/aggregation/hitlist.h index 37ed96ef534..ee7f9d861b4 100644 --- a/searchlib/src/vespa/searchlib/aggregation/hitlist.h +++ b/searchlib/src/vespa/searchlib/aggregation/hitlist.h @@ -13,8 +13,8 @@ class HitList : public expression::ResultNode public: private: using ResultNode = expression::ResultNode; - typedef std::vector<FS4Hit> Fs4V; - typedef std::vector<VdsHit> VdsV; + using Fs4V = std::vector<FS4Hit>; + using VdsV = std::vector<VdsHit>; std::vector<FS4Hit> _fs4hits; std::vector<VdsHit> _vdshits; diff --git a/searchlib/src/vespa/searchlib/aggregation/rawrank.h b/searchlib/src/vespa/searchlib/aggregation/rawrank.h index 17f7c531e89..8dd3b45e3eb 100644 --- a/searchlib/src/vespa/searchlib/aggregation/rawrank.h +++ b/searchlib/src/vespa/searchlib/aggregation/rawrank.h @@ -3,6 +3,6 @@ namespace search::aggregation { -typedef double RawRank; +using RawRank = double; } diff --git a/searchlib/src/vespa/searchlib/aggregation/vdshit.h b/searchlib/src/vespa/searchlib/aggregation/vdshit.h index b467423a182..c2f55f8a0bb 100644 --- a/searchlib/src/vespa/searchlib/aggregation/vdshit.h +++ b/searchlib/src/vespa/searchlib/aggregation/vdshit.h @@ -10,8 +10,8 @@ namespace search::aggregation { class VdsHit : public Hit { public: - typedef vespalib::Array<uint8_t> Summary; - typedef vespalib::string DocId; + using Summary = vespalib::Array<uint8_t>; + using DocId = vespalib::string; DECLARE_IDENTIFIABLE_NS2(search, aggregation, VdsHit); DECLARE_NBO_SERIALIZE; VdsHit() : Hit(), _docId(), _summary() {} diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_operation.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_operation.cpp index 55577b3916c..1222795895c 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_operation.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_operation.cpp @@ -89,7 +89,7 @@ struct UpdateFast { using F = OP; A * attr; F op; - typedef typename T::LoadedValueType ValueType; + using ValueType = typename T::LoadedValueType; UpdateFast(IAttributeVector &attr_in, typename F::V operand) : attr(dynamic_cast<A *>(&attr_in)), op(operand) diff --git a/searchlib/src/vespa/searchlib/attribute/attributefilewriter.cpp b/searchlib/src/vespa/searchlib/attribute/attributefilewriter.cpp index 655bd85dc64..7eabc71cb04 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributefilewriter.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributefilewriter.cpp @@ -44,7 +44,7 @@ updateHeader(const vespalib::string &name, uint64_t fileBitSize) f.OpenReadWrite(name.c_str()); h.readFile(f); FileHeaderContext::setFreezeTime(h); - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; h.putTag(Tag("frozen", 1)); h.putTag(Tag("fileBitSize", fileBitSize)); h.rewriteFile(f); diff --git a/searchlib/src/vespa/searchlib/attribute/attributemanager.cpp b/searchlib/src/vespa/searchlib/attribute/attributemanager.cpp index c3218302982..2db35d1fd1e 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributemanager.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributemanager.cpp @@ -23,7 +23,7 @@ namespace { std::mutex baseDirLock; std::condition_variable baseDirCond; -typedef std::set<string> BaseDirSet; +using BaseDirSet = std::set<string>; BaseDirSet baseDirSet; static void diff --git a/searchlib/src/vespa/searchlib/attribute/attributemanager.h b/searchlib/src/vespa/searchlib/attribute/attributemanager.h index 28e50490a17..88d4633afca 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributemanager.h +++ b/searchlib/src/vespa/searchlib/attribute/attributemanager.h @@ -21,9 +21,9 @@ class AttributeManager : public IAttributeManager private: using Config = attribute::Config; public: - typedef std::vector<string> StringVector; - typedef search::IndexMetaInfo::Snapshot Snapshot; - typedef std::vector<AttributeGuard> AttributeList; + using StringVector = std::vector<string>; + using Snapshot = search::IndexMetaInfo::Snapshot; + using AttributeList = std::vector<AttributeGuard>; using VectorHolder = std::shared_ptr<AttributeVector>; AttributeManager(); AttributeManager(const string & base); @@ -58,7 +58,7 @@ public: uint64_t getMemoryFootprint() const; protected: - typedef vespalib::hash_map<string, VectorHolder> AttributeMap; + using AttributeMap = vespalib::hash_map<string, VectorHolder>; AttributeMap _attributes; mutable std::mutex _loadLock; private: diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h index 261290247ad..b94f49c073f 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.h +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h @@ -107,7 +107,7 @@ public: using GenerationHandler = vespalib::GenerationHandler; using GenerationHolder = vespalib::GenerationHolder; - typedef GenerationHandler::generation_t generation_t; + using generation_t = GenerationHandler::generation_t; ~AttributeVector() override; protected: diff --git a/searchlib/src/vespa/searchlib/attribute/attrvector.h b/searchlib/src/vespa/searchlib/attribute/attrvector.h index d1d2a1e8f3c..05dd611c187 100644 --- a/searchlib/src/vespa/searchlib/attribute/attrvector.h +++ b/searchlib/src/vespa/searchlib/attribute/attrvector.h @@ -18,7 +18,7 @@ public: template <bool MULTI> struct Features { - typedef uint32_t EnumType; + using EnumType = uint32_t; static bool IsMultiValue() { return MULTI; } }; }; @@ -29,17 +29,17 @@ template <typename B> class NumericDirectAttribute : public B { private: - typedef typename B::EnumHandle EnumHandle; + using EnumHandle = typename B::EnumHandle; NumericDirectAttribute(const NumericDirectAttribute &); NumericDirectAttribute & operator=(const NumericDirectAttribute &); bool onLoad(vespalib::Executor *executor) override; typename B::BaseType getFromEnum(EnumHandle e) const override { return _data[e]; } protected: - typedef typename B::BaseType BaseType; - typedef typename B::DocId DocId; - typedef typename B::Change Change; - typedef typename B::largeint_t largeint_t; - typedef typename B::Config Config; + using BaseType = typename B::BaseType; + using DocId = typename B::DocId; + using Change = typename B::Change; + using largeint_t = typename B::largeint_t; + using Config = typename B::Config; NumericDirectAttribute(const vespalib::string & baseFileName, const Config & c); ~NumericDirectAttribute() override; @@ -59,10 +59,10 @@ template <typename F, typename B> class NumericDirectAttrVector : public search::NumericDirectAttribute<B> { protected: - typedef typename B::DocId DocId; - typedef NumericDirectAttrVector<F, B> NumDirectAttrVec; + using DocId = typename B::DocId; + using NumDirectAttrVec = NumericDirectAttrVector<F, B>; private: - typedef typename B::largeint_t largeint_t; + using largeint_t = typename B::largeint_t; public: NumericDirectAttrVector(const vespalib::string & baseFileName); NumericDirectAttrVector(const vespalib::string & baseFileName, const AttributeVector::Config & c); @@ -71,12 +71,12 @@ public: uint32_t get(DocId doc, largeint_t * v, uint32_t sz) const override { return getAllHelper<largeint_t, largeint_t>(doc, v, sz); } uint32_t get(DocId doc, double * v, uint32_t sz) const override { return getAllHelper<double, double>(doc, v, sz); } private: - typedef typename B::EnumHandle EnumHandle; - typedef typename B::BaseType BaseType; - typedef typename B::Weighted Weighted; - typedef typename B::WeightedEnum WeightedEnum; - typedef typename B::WeightedInt WeightedInt; - typedef typename B::WeightedFloat WeightedFloat; + using EnumHandle = typename B::EnumHandle; + using BaseType = typename B::BaseType; + using Weighted = typename B::Weighted; + using WeightedEnum = typename B::WeightedEnum; + using WeightedInt = typename B::WeightedInt; + using WeightedFloat = typename B::WeightedFloat; BaseType get(DocId doc) const override { return getHelper(doc, 0); } EnumHandle getEnum(DocId doc) const override { return getEnumHelper(doc, 0); } uint32_t get(DocId doc, EnumHandle * e, uint32_t sz) const override { return getAllEnumHelper(doc, e, sz); } diff --git a/searchlib/src/vespa/searchlib/attribute/changevector.h b/searchlib/src/vespa/searchlib/attribute/changevector.h index 5f858a3e012..e75f5c255de 100644 --- a/searchlib/src/vespa/searchlib/attribute/changevector.h +++ b/searchlib/src/vespa/searchlib/attribute/changevector.h @@ -61,7 +61,7 @@ private: double _arithOperand; T _v; public: - typedef T DataType; + using DataType = T; NumericChangeData(T v) : _arithOperand(0), _v(v) { } NumericChangeData() : _arithOperand(0), _v(T()) { } @@ -77,7 +77,7 @@ public: class StringChangeData { public: - typedef vespalib::string DataType; + using DataType = vespalib::string; StringChangeData(const DataType & s); StringChangeData() : _s() { } @@ -93,7 +93,7 @@ private: template<typename T> struct ChangeTemplate : public ChangeBase { - typedef T DataType; + using DataType = T; ChangeTemplate() : ChangeBase() { } ChangeTemplate(Type type, uint32_t d, const T & v, int32_t w = 1) : diff --git a/searchlib/src/vespa/searchlib/attribute/configconverter.cpp b/searchlib/src/vespa/searchlib/attribute/configconverter.cpp index 894ede513a2..a2079a88ddf 100644 --- a/searchlib/src/vespa/searchlib/attribute/configconverter.cpp +++ b/searchlib/src/vespa/searchlib/attribute/configconverter.cpp @@ -12,8 +12,8 @@ namespace { using vespalib::eval::ValueType; using vespalib::eval::CellType; -typedef std::map<AttributesConfig::Attribute::Datatype, BasicType::Type> DataTypeMap; -typedef std::map<AttributesConfig::Attribute::Collectiontype, CollectionType::Type> CollectionTypeMap; +using DataTypeMap = std::map<AttributesConfig::Attribute::Datatype, BasicType::Type>; +using CollectionTypeMap = std::map<AttributesConfig::Attribute::Collectiontype, CollectionType::Type>; DataTypeMap getDataTypeMap() diff --git a/searchlib/src/vespa/searchlib/attribute/diversity.cpp b/searchlib/src/vespa/searchlib/attribute/diversity.cpp index d73ab086d19..87735e1bc35 100644 --- a/searchlib/src/vespa/searchlib/attribute/diversity.cpp +++ b/searchlib/src/vespa/searchlib/attribute/diversity.cpp @@ -10,7 +10,7 @@ namespace search::attribute::diversity { template <typename T> struct FetchNumberFast { const T * const attr; - typedef typename T::LoadedValueType ValueType; + using ValueType = typename T::LoadedValueType; FetchNumberFast(const IAttributeVector &attr_in) : attr(dynamic_cast<const T *>(&attr_in)) {} ValueType get(uint32_t docid) const { return attr->getFast(docid); } bool valid() const { return (attr != nullptr); } @@ -18,7 +18,7 @@ struct FetchNumberFast { struct FetchEnumFast { IAttributeVector::EnumRefs enumRefs; - typedef uint32_t ValueType; + using ValueType = uint32_t; FetchEnumFast(const IAttributeVector &attr) : enumRefs(attr.make_enum_read_view()) {} ValueType get(uint32_t docid) const { return enumRefs[docid].load_relaxed().ref(); } bool valid() const { return ! enumRefs.empty(); } @@ -26,21 +26,21 @@ struct FetchEnumFast { struct FetchEnum { const IAttributeVector *attr; - typedef uint32_t ValueType; + using ValueType = uint32_t; FetchEnum(const IAttributeVector & attr_in) : attr(&attr_in) {} ValueType get(uint32_t docid) const { return attr->getEnum(docid); } }; struct FetchInteger { const IAttributeVector * attr; - typedef int64_t ValueType; + using ValueType = int64_t; FetchInteger(const IAttributeVector & attr_in) : attr(&attr_in) {} ValueType get(uint32_t docid) const { return attr->getInt(docid); } }; struct FetchFloat { const IAttributeVector * attr; - typedef double ValueType; + using ValueType = double; FetchFloat(const IAttributeVector & attr_in) : attr(&attr_in) {} ValueType get(uint32_t docid) const { return attr->getFloat(docid); } }; @@ -54,7 +54,7 @@ private: size_t _cutoff_max_groups; bool _cutoff_strict; - typedef vespalib::hash_map<typename Fetcher::ValueType, uint32_t> Diversity; + using Diversity = vespalib::hash_map<typename Fetcher::ValueType, uint32_t>; Diversity _seen; public: DiversityFilterT(Fetcher diversity, size_t max_per_group, size_t cutoff_max_groups, diff --git a/searchlib/src/vespa/searchlib/attribute/extendableattributes.h b/searchlib/src/vespa/searchlib/attribute/extendableattributes.h index a3a0de5bfc5..cc2cb216bbb 100644 --- a/searchlib/src/vespa/searchlib/attribute/extendableattributes.h +++ b/searchlib/src/vespa/searchlib/attribute/extendableattributes.h @@ -13,19 +13,19 @@ namespace search { // Translates the actual value type to the type required by IExtendAttribute. template <typename T> struct AddValueType { - typedef int64_t Type; + using Type = int64_t; }; template <> struct AddValueType<double> { - typedef double Type; + using Type = double; }; //******************** CollectionType::SINGLE ********************// template <typename T> struct AttributeTemplate { - typedef search::IntegerAttributeTemplate<T> Type; + using Type = search::IntegerAttributeTemplate<T>; }; template <> struct AttributeTemplate<double> { - typedef search::FloatingPointAttributeTemplate<double> Type; + using Type = search::FloatingPointAttributeTemplate<double>; }; template <typename T> @@ -84,9 +84,9 @@ class MultiExtAttribute public attribute::IMultiValueAttribute { protected: - typedef typename MultiExtAttribute<T>::NumDirectAttrVec Super; - typedef typename Super::Config Config; - typedef typename Super::BasicType BasicType; + using Super = typename MultiExtAttribute<T>::NumDirectAttrVec; + using Config = typename Super::Config; + using BasicType = typename Super::BasicType; using QueryTermSimpleUP = AttributeVector::QueryTermSimpleUP; MultiExtAttribute(const vespalib::string &name, const attribute::CollectionType &ctype); diff --git a/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.h b/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.h index 924e5362be7..4a65f7251be 100644 --- a/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.h +++ b/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.h @@ -18,7 +18,7 @@ private: using IIterator = queryeval::sourceselector::Iterator; public: - typedef std::unique_ptr<FixedSourceSelector> UP; + using UP = std::unique_ptr<FixedSourceSelector>; class Iterator : public IIterator { private: AttributeGuard _attributeGuard; diff --git a/searchlib/src/vespa/searchlib/attribute/flagattribute.h b/searchlib/src/vespa/searchlib/attribute/flagattribute.h index df75e7afa04..056f58f3feb 100644 --- a/searchlib/src/vespa/searchlib/attribute/flagattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/flagattribute.h @@ -8,14 +8,14 @@ namespace search { -typedef MultiValueNumericAttribute< IntegerAttributeTemplate<int8_t>, int8_t > FlagBaseImpl; +using FlagBaseImpl = MultiValueNumericAttribute< IntegerAttributeTemplate<int8_t>, int8_t >; template <typename B> class FlagAttributeT : public B { public: FlagAttributeT(const vespalib::string & baseFileName, const AttributeVector::Config & cfg); private: - typedef AttributeVector::DocId DocId; + using DocId = AttributeVector::DocId; bool onLoad(vespalib::Executor *executor) override; bool onLoadEnumerated(ReaderBase &attrReader) override; std::unique_ptr<attribute::SearchContext> @@ -43,7 +43,7 @@ private: uint32_t _bitVectorSize; }; -typedef FlagAttributeT<FlagBaseImpl> FlagAttribute; +using FlagAttribute = FlagAttributeT<FlagBaseImpl>; } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h index c6dc7dc977d..3fa4bb7c5ce 100644 --- a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h @@ -21,16 +21,16 @@ class MultiValueAttribute : public B, public attribute::IMultiValueAttribute { protected: - typedef typename B::DocId DocId; - typedef typename B::Change Change; - typedef typename B::ChangeVector ChangeVector; + using DocId = typename B::DocId; + using Change = typename B::Change; + using ChangeVector = typename B::ChangeVector; using MultiValueType = M; using MultiValueMapping = attribute::MultiValueMapping<MultiValueType>; using ValueType = multivalue::ValueType_t<MultiValueType>; - typedef std::vector<MultiValueType> ValueVector; + using ValueVector = std::vector<MultiValueType>; using MultiValueArrayRef = vespalib::ConstArrayRef<MultiValueType>; - typedef std::vector<std::pair<DocId, ValueVector> > DocumentValues; + using DocumentValues = std::vector<std::pair<DocId, ValueVector> >; using NonAtomicValueType = attribute::atomic_utils::NonAtomicValue_t<ValueType>; MultiValueMapping _mvMapping; diff --git a/searchlib/src/vespa/searchlib/attribute/numericbase.h b/searchlib/src/vespa/searchlib/attribute/numericbase.h index f19ddcca706..0e400d4b4e9 100644 --- a/searchlib/src/vespa/searchlib/attribute/numericbase.h +++ b/searchlib/src/vespa/searchlib/attribute/numericbase.h @@ -13,8 +13,8 @@ class ReaderBase; class NumericAttribute : public AttributeVector { protected: - typedef IEnumStore::Index EnumIndex; - typedef IEnumStore::EnumVector EnumVector; + using EnumIndex = IEnumStore::Index; + using EnumVector = IEnumStore::EnumVector; NumericAttribute(const vespalib::string & name, const AttributeVector::Config & cfg) : AttributeVector(name, cfg) diff --git a/searchlib/src/vespa/searchlib/attribute/postingchange.cpp b/searchlib/src/vespa/searchlib/attribute/postingchange.cpp index 7f3ba027d7a..0ce0c50f718 100644 --- a/searchlib/src/vespa/searchlib/attribute/postingchange.cpp +++ b/searchlib/src/vespa/searchlib/attribute/postingchange.cpp @@ -25,7 +25,7 @@ struct CompareValue { void removeDupAdditions(PostingChange<AttributePosting>::A &additions) { - typedef PostingChange<AttributePosting>::A::iterator Iterator; + using Iterator = PostingChange<AttributePosting>::A::iterator; if (additions.empty()) return; if (additions.size() == 1) @@ -53,7 +53,7 @@ removeDupAdditions(PostingChange<AttributePosting>::A &additions) void removeDupAdditions(PostingChange<AttributeWeightPosting>::A &additions) { - typedef PostingChange<AttributeWeightPosting>::A::iterator Iterator; + using Iterator = PostingChange<AttributeWeightPosting>::A::iterator; if (additions.empty()) return; if (additions.size() == 1u) @@ -85,7 +85,7 @@ removeDupAdditions(PostingChange<AttributeWeightPosting>::A &additions) void removeDupRemovals(std::vector<uint32_t> &removals) { - typedef std::vector<uint32_t>::iterator Iterator; + using Iterator = std::vector<uint32_t>::iterator; if (removals.empty()) return; if (removals.size() == 1u) @@ -299,7 +299,7 @@ PostingChangeComputerT<WeightedIndex, PostingMap>:: compute(const MultivalueMapping & mvm, const DocIndices & docIndices, const vespalib::datastore::EntryComparator & compare, const EnumIndexMapper & mapper) { - typedef ActualChangeComputer<WeightedIndex> AC; + using AC = ActualChangeComputer<WeightedIndex>; AC actualChange(compare, mapper); typename AC::AlwaysWeightedIndexVector added, changed, removed; PostingMap changePost; @@ -327,15 +327,15 @@ template class PostingChange<AttributePosting>; template class PostingChange<AttributeWeightPosting>; -typedef PostingChange<vespalib::btree::BTreeKeyData<unsigned int, int> > WeightedPostingChange; -typedef std::map<EnumPostingPair, WeightedPostingChange> WeightedPostingChangeMap; -typedef multivalue::WeightedValue<AtomicEntryRef> WeightedIndex; -typedef AtomicEntryRef ValueIndex; +using WeightedPostingChange = PostingChange<vespalib::btree::BTreeKeyData<unsigned int, int> >; +using WeightedPostingChangeMap = std::map<EnumPostingPair, WeightedPostingChange>; +using WeightedIndex = multivalue::WeightedValue<AtomicEntryRef>; +using ValueIndex = AtomicEntryRef; using WeightedMultiValueMapping = attribute::MultiValueMapping<WeightedIndex>; using ValueMultiValueMapping = attribute::MultiValueMapping<ValueIndex>; -typedef std::vector<std::pair<uint32_t, std::vector<WeightedIndex>>> DocIndicesWeighted; -typedef std::vector<std::pair<uint32_t, std::vector<ValueIndex>>> DocIndicesValue; +using DocIndicesWeighted = std::vector<std::pair<uint32_t, std::vector<WeightedIndex>>>; +using DocIndicesValue = std::vector<std::pair<uint32_t, std::vector<ValueIndex>>>; template WeightedPostingChangeMap PostingChangeComputerT<WeightedIndex, WeightedPostingChangeMap> ::compute<WeightedMultiValueMapping>(const WeightedMultiValueMapping &, diff --git a/searchlib/src/vespa/searchlib/attribute/postingchange.h b/searchlib/src/vespa/searchlib/attribute/postingchange.h index 19b638809e0..0da25741e44 100644 --- a/searchlib/src/vespa/searchlib/attribute/postingchange.h +++ b/searchlib/src/vespa/searchlib/attribute/postingchange.h @@ -19,8 +19,8 @@ template <typename P> class PostingChange { public: - typedef vespalib::Array<P> A; - typedef std::vector<uint32_t> R; + using A = vespalib::Array<P>; + using R = std::vector<uint32_t>; A _additions; R _removals; @@ -57,7 +57,7 @@ template <typename WeightedIndex, typename PostingMap> class PostingChangeComputerT { private: - typedef std::vector<std::pair<uint32_t, std::vector<WeightedIndex>>> DocIndices; + using DocIndices = std::vector<std::pair<uint32_t, std::vector<WeightedIndex>>>; public: template <typename MultivalueMapping> static PostingMap compute(const MultivalueMapping & mvm, const DocIndices & docIndices, diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h index e0bf85c4e70..2a83d22929a 100644 --- a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h +++ b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h @@ -193,7 +193,7 @@ class NumericPostingSearchContext { private: using Parent = PostingSearchContext<BaseSC, PostingListSearchContextT<DataT>, AttrT>; - typedef typename AttrT::T BaseType; + using BaseType = typename AttrT::T; using Params = attribute::SearchContextParams; using Parent::_low; using Parent::_high; diff --git a/searchlib/src/vespa/searchlib/attribute/postingstore.h b/searchlib/src/vespa/searchlib/attribute/postingstore.h index aabe5840618..ea7c5e0986b 100644 --- a/searchlib/src/vespa/searchlib/attribute/postingstore.h +++ b/searchlib/src/vespa/searchlib/attribute/postingstore.h @@ -67,22 +67,22 @@ class PostingStore : public PostingListTraits<DataT>::PostingStoreBase, { vespalib::datastore::BufferType<BitVectorEntry> _bvType; public: - typedef DataT DataType; - typedef typename PostingListTraits<DataT>::PostingStoreBase Parent; - typedef typename Parent::AddIter AddIter; - typedef typename Parent::RemoveIter RemoveIter; - typedef typename Parent::RefType RefType; - typedef typename Parent::BTreeType BTreeType; - typedef typename Parent::Iterator Iterator; - typedef typename Parent::ConstIterator ConstIterator; - typedef typename Parent::KeyDataType KeyDataType; - typedef typename Parent::AggregatedType AggregatedType; - typedef typename Parent::BTreeTypeRefPair BTreeTypeRefPair; - typedef typename Parent::Builder Builder; + using DataType = DataT; + using Parent = typename PostingListTraits<DataT>::PostingStoreBase; + using AddIter = typename Parent::AddIter; + using RemoveIter = typename Parent::RemoveIter; + using RefType = typename Parent::RefType; + using BTreeType = typename Parent::BTreeType; + using Iterator = typename Parent::Iterator; + using ConstIterator = typename Parent::ConstIterator; + using KeyDataType = typename Parent::KeyDataType; + using AggregatedType = typename Parent::AggregatedType; + using BTreeTypeRefPair = typename Parent::BTreeTypeRefPair; + using Builder = typename Parent::Builder; using CompactionSpec = vespalib::datastore::CompactionSpec; using CompactionStrategy = vespalib::datastore::CompactionStrategy; - typedef vespalib::datastore::EntryRef EntryRef; - typedef std::less<uint32_t> CompareT; + using EntryRef = vespalib::datastore::EntryRef; + using CompareT = std::less<uint32_t>; using Parent::applyNewArray; using Parent::applyNewTree; using Parent::applyCluster; @@ -103,7 +103,7 @@ public: using Parent::_allocator; using Parent::_aggrCalc; using Parent::BUFFERTYPE_BTREE; - typedef vespalib::datastore::Handle<BitVectorEntry> BitVectorRefPair; + using BitVectorRefPair = vespalib::datastore::Handle<BitVectorEntry>; PostingStore(IEnumStoreDictionary& dictionary, Status &status, const Config &config); diff --git a/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h b/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h index 159e71e99e3..e4aa6c67a05 100644 --- a/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h +++ b/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h @@ -33,8 +33,8 @@ private: */ class PredicateAttribute : public NotImplementedAttribute { public: - typedef uint8_t MinFeature; - typedef std::pair<const MinFeature *, size_t> MinFeatureHandle; + using MinFeature = uint8_t; + using MinFeatureHandle = std::pair<const MinFeature *, size_t>; using IntervalRange = uint16_t; using IntervalRangeVector = vespalib::RcuVectorBase<IntervalRange>; @@ -85,7 +85,7 @@ private: int64_t _lower_bound; int64_t _upper_bound; - typedef vespalib::RcuVectorBase<uint8_t> MinFeatureVector; + using MinFeatureVector = vespalib::RcuVectorBase<uint8_t>; MinFeatureVector _min_feature; IntervalRangeVector _interval_range_vector; diff --git a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h index b2af8752fa4..e731baf153b 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h @@ -15,19 +15,19 @@ class GrowStrategy; class SingleValueSmallNumericAttribute : public IntegerAttributeTemplate<int8_t> { private: - typedef IntegerAttributeTemplate<int8_t> B; - typedef B::BaseType T; - typedef B::DocId DocId; - typedef B::EnumHandle EnumHandle; - typedef B::largeint_t largeint_t; - typedef B::Weighted Weighted; - typedef B::WeightedInt WeightedInt; - typedef B::WeightedFloat WeightedFloat; - typedef B::WeightedEnum WeightedEnum; - typedef B::generation_t generation_t; + using B = IntegerAttributeTemplate<int8_t>; + using T = B::BaseType; + using DocId = B::DocId; + using EnumHandle = B::EnumHandle; + using largeint_t = B::largeint_t; + using Weighted = B::Weighted; + using WeightedInt = B::WeightedInt; + using WeightedFloat = B::WeightedFloat; + using WeightedEnum = B::WeightedEnum; + using generation_t = B::generation_t; protected: - typedef uint32_t Word; // Large enough to contain numDocs. + using Word = uint32_t; // Large enough to contain numDocs. private: Word _valueMask; // 0x01, 0x03 or 0x0f uint32_t _valueShiftShift; // 0x00, 0x01 or 0x02 diff --git a/searchlib/src/vespa/searchlib/attribute/sourceselector.cpp b/searchlib/src/vespa/searchlib/attribute/sourceselector.cpp index 26a98f488ac..b7a7ebc0c3a 100644 --- a/searchlib/src/vespa/searchlib/attribute/sourceselector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/sourceselector.cpp @@ -33,7 +33,7 @@ public: virtual void addTags(GenericHeader &header, const vespalib::string &name) const override { - typedef GenericHeader::Tag Tag; + using Tag = GenericHeader::Tag; _parent.addTags(header, name); header.putTag(Tag(defaultSourceTag, _hi._defaultSource)); header.putTag(Tag(baseIdTag, _hi._baseId)); diff --git a/searchlib/src/vespa/searchlib/attribute/sourceselector.h b/searchlib/src/vespa/searchlib/attribute/sourceselector.h index de92abf212e..1c1f7ca1a9e 100644 --- a/searchlib/src/vespa/searchlib/attribute/sourceselector.h +++ b/searchlib/src/vespa/searchlib/attribute/sourceselector.h @@ -35,8 +35,8 @@ public: HeaderInfo _header; AttributeMemorySaveTarget _memSaver; public: - typedef std::unique_ptr<SaveInfo> UP; - typedef std::shared_ptr<SaveInfo> SP; + using UP = std::unique_ptr<SaveInfo>; + using SP = std::shared_ptr<SaveInfo>; SaveInfo(const vespalib::string & baseFileName, queryeval::Source defaultSource, uint32_t baseId, @@ -52,7 +52,7 @@ public: private: HeaderInfo _header; public: - typedef std::unique_ptr<LoadInfo> UP; + using UP = std::unique_ptr<LoadInfo>; LoadInfo(const vespalib::string & baseFileName); void load(); const HeaderInfo & header() const { return _header; } @@ -68,7 +68,7 @@ public: }; public: - typedef std::unique_ptr<SourceSelector> UP; + using UP = std::unique_ptr<SourceSelector>; SourceSelector(queryeval::Source defaultSource, AttributeVector::SP realSource); /** * This will compute the distribution of the sources used over the whole lid space. diff --git a/searchlib/src/vespa/searchlib/bitcompression/compression.cpp b/searchlib/src/vespa/searchlib/bitcompression/compression.cpp index b60250256f4..4752ddfb64f 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/compression.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/compression.cpp @@ -187,7 +187,7 @@ void FeatureEncodeContext<bigEndian>:: writeBits(const uint64_t *bits, uint32_t bitOffset, uint32_t bitLength) { - typedef FeatureEncodeContext<bigEndian> EC; + using EC = FeatureEncodeContext<bigEndian>; UC64_ENCODECONTEXT_CONSTRUCTOR(o, _); if (bitOffset + bitLength < 64) { diff --git a/searchlib/src/vespa/searchlib/bitcompression/compression.h b/searchlib/src/vespa/searchlib/bitcompression/compression.h index 74231638213..7c5ba3e94ca 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/compression.h +++ b/searchlib/src/vespa/searchlib/bitcompression/compression.h @@ -712,7 +712,7 @@ public: END_BUFFER_SAFETY = 4 }; - typedef uint64_t UnitType; + using UnitType = uint64_t; // Pointers to compressed data uint64_t *_valI; @@ -941,16 +941,16 @@ EncodeContext64EBase<false>::bswap(uint64_t val) return val; } -typedef EncodeContext64EBase<true> EncodeContext64BEBase; +using EncodeContext64BEBase = EncodeContext64EBase<true>; -typedef EncodeContext64EBase<false> EncodeContext64LEBase; +using EncodeContext64LEBase = EncodeContext64EBase<false>; template<bool bigEndian> class EncodeContext64 : public EncodeContext64EBase<bigEndian> { public: - typedef EncodeContext64EBase<bigEndian> BaseClass; + using BaseClass = EncodeContext64EBase<bigEndian>; using BaseClass::writeBits; /** @@ -1068,9 +1068,9 @@ public: }; -typedef EncodeContext64<true> EncodeContext64BE; +using EncodeContext64BE = EncodeContext64<true>; -typedef EncodeContext64<false> EncodeContext64LE; +using EncodeContext64LE = EncodeContext64<false>; class DecodeContext64Base : public search::ComprFileDecodeContext { @@ -1274,7 +1274,7 @@ private: DecodeContext64(const DecodeContext64 &); public: - typedef EncodeContext64<bigEndian> EC; + using EC = EncodeContext64<bigEndian>; DecodeContext64() = default; @@ -1476,17 +1476,17 @@ public: } }; -typedef DecodeContext64<true> DecodeContext64BE; +using DecodeContext64BE = DecodeContext64<true>; -typedef DecodeContext64<false> DecodeContext64LE; +using DecodeContext64LE = DecodeContext64<false>; template <bool bigEndian> class FeatureDecodeContext : public DecodeContext64<bigEndian> { public: - typedef DecodeContext64<bigEndian> ParentClass; - typedef index::DocIdAndFeatures DocIdAndFeatures; - typedef index::PostingListParams PostingListParams; + using ParentClass = DecodeContext64<bigEndian>; + using DocIdAndFeatures = index::DocIdAndFeatures; + using PostingListParams = index::PostingListParams; using ParentClass::_val; using ParentClass::_valI; using ParentClass::_valE; @@ -1525,18 +1525,18 @@ public: virtual void getParams(PostingListParams ¶ms) const; }; -typedef FeatureDecodeContext<true> FeatureDecodeContextBE; +using FeatureDecodeContextBE = FeatureDecodeContext<true>; -typedef FeatureDecodeContext<false> FeatureDecodeContextLE; +using FeatureDecodeContextLE = FeatureDecodeContext<false>; template <bool bigEndian> class FeatureEncodeContext : public EncodeContext64<bigEndian> { public: search::ComprFileWriteContext *_writeContext; - typedef EncodeContext64<bigEndian> ParentClass; - typedef index::DocIdAndFeatures DocIdAndFeatures; - typedef index::PostingListParams PostingListParams; + using ParentClass = EncodeContext64<bigEndian>; + using DocIdAndFeatures = index::DocIdAndFeatures; + using PostingListParams = index::PostingListParams; using ParentClass::_cacheInt; using ParentClass::_cacheFree; using ParentClass::smallPadBits; @@ -1607,9 +1607,9 @@ public: virtual void getParams(PostingListParams ¶ms) const; }; -typedef FeatureEncodeContext<true> FeatureEncodeContextBE; +using FeatureEncodeContextBE = FeatureEncodeContext<true>; -typedef FeatureEncodeContext<false> FeatureEncodeContextLE; +using FeatureEncodeContextLE = FeatureEncodeContext<false>; extern template class FeatureDecodeContext<true>; extern template class FeatureDecodeContext<false>; diff --git a/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp b/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp index c5943309817..cdae8058d76 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/countcompression.cpp @@ -124,7 +124,7 @@ writeCounts(const PostingListCounts &counts) encodeExpGolomb(numChunks, K_VALUE_COUNTFILE_NUMCHUNKS); } if (numChunks != 0) { - typedef std::vector<PostingListCounts::Segment>::const_iterator segit; + using segit = std::vector<PostingListCounts::Segment>::const_iterator; segit ite = counts._segments.end(); diff --git a/searchlib/src/vespa/searchlib/bitcompression/countcompression.h b/searchlib/src/vespa/searchlib/bitcompression/countcompression.h index 6eb37e1d1ad..2f3b0646bdb 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/countcompression.h +++ b/searchlib/src/vespa/searchlib/bitcompression/countcompression.h @@ -13,8 +13,8 @@ namespace search::bitcompression { class PostingListCountFileDecodeContext : public FeatureDecodeContext<true> { public: - typedef FeatureDecodeContext<true> ParentClass; - typedef index::PostingListCounts PostingListCounts; + using ParentClass = FeatureDecodeContext<true>; + using PostingListCounts = index::PostingListCounts; uint32_t _avgBitsPerDoc; // Average number of bits per document uint32_t _minChunkDocs; // Minimum number of documents for chunking uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) @@ -42,8 +42,8 @@ public: class PostingListCountFileEncodeContext : public FeatureEncodeContext<true> { public: - typedef FeatureEncodeContext<true> ParentClass; - typedef index::PostingListCounts PostingListCounts; + using ParentClass = FeatureEncodeContext<true>; + using PostingListCounts = index::PostingListCounts; uint32_t _avgBitsPerDoc; // Average number of bits per document uint32_t _minChunkDocs; // Minimum number of documents for chunking uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) diff --git a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp index b0a201d913e..835aaadc559 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp @@ -57,7 +57,7 @@ PageDict4PageParams::getFileHeaderPad(uint32_t offset) } -typedef PageDict4StartOffset StartOffset; +using StartOffset = PageDict4StartOffset; #define K_VALUE_COUNTFILE_L1_FILEOFFSET 7 #define K_VALUE_COUNTFILE_L2_FILEOFFSET 11 @@ -145,7 +145,7 @@ readStartOffset(PostingListCountFileDecodeContext &d, uint32_t fileOffsetK, uint32_t accNumDocsK) { - typedef PostingListCountFileEncodeContext EC; + using EC = PostingListCountFileEncodeContext; UC64_DECODECONTEXT(o); uint32_t length; diff --git a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h index 421032c95ec..9208a5be3b8 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h +++ b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h @@ -79,7 +79,7 @@ class PageDict4PageParams { public: using Counts = index::PostingListCounts; - typedef PageDict4StartOffset StartOffset; + using StartOffset = PageDict4StartOffset; static uint32_t getPageByteSize() { return 4096; } static uint32_t getPageBitSize() { return getPageByteSize() * 8; } @@ -114,8 +114,8 @@ public: class PageDict4SSWriter : public PageDict4PageParams { - typedef PostingListCountFileEncodeContext EC; - typedef EC SSEC; + using EC = PostingListCountFileEncodeContext; + using SSEC = EC; private: EC &_eL6; // L6 stream @@ -177,8 +177,8 @@ public: class PageDict4SPWriter : public PageDict4PageParams { - typedef PostingListCountFileEncodeContext EC; - typedef PageDict4SSWriter SSWriter; + using EC = PostingListCountFileEncodeContext; + using SSWriter = PageDict4SSWriter; private: EC _eL3; // L3 stream @@ -293,8 +293,8 @@ public: class PageDict4PWriter : public PageDict4PageParams { public: - typedef PageDict4SPWriter SPWriter; - typedef PostingListCountFileEncodeContext EC; + using SPWriter = PageDict4SPWriter; + using EC = PostingListCountFileEncodeContext; private: EC _eCounts; // counts stream (sparse counts) @@ -372,7 +372,7 @@ class PageDict4SSLookupRes { public: using Counts = index::PostingListCounts; - typedef PageDict4StartOffset StartOffset; + using StartOffset = PageDict4StartOffset; vespalib::string _l6Word; // last L6 word before key vespalib::string _lastWord; // L6 or overflow word >= key @@ -398,8 +398,8 @@ public: class PageDict4SSReader : public PageDict4PageParams { - typedef PostingListCountFileEncodeContext EC; - typedef PostingListCountFileDecodeContext DC; + using EC = PostingListCountFileEncodeContext; + using DC = PostingListCountFileDecodeContext; public: class L7Entry { @@ -472,7 +472,7 @@ public: uint64_t _ssFileBitLen; // File size in bits uint32_t _ssStartOffset; // Header size in bits - typedef std::vector<L7Entry> L7Vector; + using L7Vector = std::vector<L7Entry>; L7Vector _l7;// Uncompressed skip list for sparse sparse file DC _ssd; // used to store compression parameters @@ -485,7 +485,7 @@ public: uint32_t _pFirstPageNum; uint32_t _pFirstPageOffset; - typedef std::vector<OverflowRef> OverflowVector; + using OverflowVector = std::vector<OverflowRef>; OverflowVector _overflows; PageDict4SSReader(ComprBuffer &cb, @@ -506,9 +506,9 @@ public: class PageDict4SPLookupRes : public PageDict4PageParams { - typedef PostingListCountFileEncodeContext EC; - typedef PostingListCountFileDecodeContext DC; - typedef PageDict4SSReader SSReader; + using EC = PostingListCountFileEncodeContext; + using DC = PostingListCountFileDecodeContext; + using SSReader = PageDict4SSReader; public: vespalib::string _l3Word; @@ -537,9 +537,9 @@ public: class PageDict4PLookupRes : public PageDict4PageParams { public: - typedef PostingListCountFileEncodeContext EC; - typedef PostingListCountFileDecodeContext DC; - typedef PageDict4SSReader SSReader; + using EC = PostingListCountFileEncodeContext; + using DC = PostingListCountFileDecodeContext; + using SSReader = PageDict4SSReader; public: Counts _counts; @@ -566,9 +566,9 @@ public: class PageDict4Reader : public PageDict4PageParams { public: - typedef PostingListCountFileDecodeContext DC; - typedef PostingListCountFileEncodeContext EC; - typedef PageDict4SSReader SSReader; + using DC = PostingListCountFileDecodeContext; + using EC = PostingListCountFileEncodeContext; + using SSReader = PageDict4SSReader; DC &_pd; uint32_t _countsResidue; @@ -576,7 +576,7 @@ public: uint64_t _pFileBitLen; StartOffset _startOffset; bool _overflowPage; - typedef std::vector<Counts> PCV; + using PCV = std::vector<Counts>; struct L1SkipCheck { uint32_t wordOffset; @@ -675,7 +675,7 @@ public: PCV _counts; PCV::const_iterator _cc; PCV::const_iterator _ce; - typedef std::vector<char> WV; + using WV = std::vector<char>; WV _words; WV::const_iterator _wc; WV::const_iterator _we; diff --git a/searchlib/src/vespa/searchlib/bitcompression/posocc_field_params.h b/searchlib/src/vespa/searchlib/bitcompression/posocc_field_params.h index ef6b10d44b4..9894bfb112d 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/posocc_field_params.h +++ b/searchlib/src/vespa/searchlib/bitcompression/posocc_field_params.h @@ -18,8 +18,8 @@ namespace search::bitcompression { class PosOccFieldParams { public: - typedef index::PostingListParams PostingListParams; - typedef index::Schema Schema; + using PostingListParams = index::PostingListParams; + using Schema = index::Schema; enum CollectionType { diff --git a/searchlib/src/vespa/searchlib/bitcompression/posocc_fields_params.h b/searchlib/src/vespa/searchlib/bitcompression/posocc_fields_params.h index 1cf677bc04a..963a80f06dc 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/posocc_fields_params.h +++ b/searchlib/src/vespa/searchlib/bitcompression/posocc_fields_params.h @@ -18,8 +18,8 @@ class PosOccFieldsParams std::vector<PosOccFieldParams> _params; public: - typedef index::PostingListParams PostingListParams; - typedef index::Schema Schema; + using PostingListParams = index::PostingListParams; + using Schema = index::Schema; PosOccFieldsParams(); PosOccFieldsParams(const PosOccFieldsParams &rhs); diff --git a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.h b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.h index aadd58f9152..2dc747f6265 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.h +++ b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.h @@ -24,7 +24,7 @@ template <bool bigEndian> class EG2PosOccDecodeContext : public FeatureDecodeContext<bigEndian> { public: - typedef FeatureDecodeContext<bigEndian> ParentClass; + using ParentClass = FeatureDecodeContext<bigEndian>; using ParentClass::smallAlign; using ParentClass::readBits; using ParentClass::_valI; @@ -35,8 +35,8 @@ public: using ParentClass::_fileReadBias; using ParentClass::_readContext; using ParentClass::readHeader; - typedef EncodeContext64<bigEndian> EC; - typedef index::PostingListParams PostingListParams; + using EC = EncodeContext64<bigEndian>; + using PostingListParams = index::PostingListParams; const PosOccFieldsParams *_fieldsParams; @@ -86,7 +86,7 @@ template <bool bigEndian> class EG2PosOccDecodeContextCooked : public EG2PosOccDecodeContext<bigEndian> { public: - typedef EG2PosOccDecodeContext<bigEndian> ParentClass; + using ParentClass = EG2PosOccDecodeContext<bigEndian>; using ParentClass::smallAlign; using ParentClass::readBits; using ParentClass::_valI; @@ -97,8 +97,8 @@ public: using ParentClass::_fileReadBias; using ParentClass::_readContext; using ParentClass::_fieldsParams; - typedef EncodeContext64<bigEndian> EC; - typedef index::PostingListParams PostingListParams; + using EC = EncodeContext64<bigEndian>; + using PostingListParams = index::PostingListParams; EG2PosOccDecodeContextCooked(const PosOccFieldsParams *fieldsParams) : EG2PosOccDecodeContext<bigEndian>(fieldsParams) @@ -138,9 +138,9 @@ template <bool bigEndian> class EG2PosOccEncodeContext : public FeatureEncodeContext<bigEndian> { public: - typedef FeatureEncodeContext<bigEndian> ParentClass; - typedef index::DocIdAndFeatures DocIdAndFeatures; - typedef index::PostingListParams PostingListParams; + using ParentClass = FeatureEncodeContext<bigEndian>; + using DocIdAndFeatures = index::DocIdAndFeatures; + using PostingListParams = index::PostingListParams; using ParentClass::smallAlign; using ParentClass::writeBits; using ParentClass::_valI; @@ -179,9 +179,9 @@ template <bool bigEndian> class EGPosOccDecodeContext : public EG2PosOccDecodeContext<bigEndian> { public: - typedef EG2PosOccDecodeContext<bigEndian> ParentClass; - typedef index::DocIdAndFeatures DocIdAndFeatures; - typedef index::PostingListParams PostingListParams; + using ParentClass = EG2PosOccDecodeContext<bigEndian>; + using DocIdAndFeatures = index::DocIdAndFeatures; + using PostingListParams = index::PostingListParams; using ParentClass::smallAlign; using ParentClass::readBits; using ParentClass::_valI; @@ -193,7 +193,7 @@ public: using ParentClass::_readContext; using ParentClass::_fieldsParams; using ParentClass::readHeader; - typedef EncodeContext64<bigEndian> EC; + using EC = EncodeContext64<bigEndian>; EGPosOccDecodeContext(const PosOccFieldsParams *fieldsParams) : EG2PosOccDecodeContext<bigEndian>(fieldsParams) @@ -238,9 +238,9 @@ template <bool bigEndian> class EGPosOccDecodeContextCooked : public EGPosOccDecodeContext<bigEndian> { public: - typedef EGPosOccDecodeContext<bigEndian> ParentClass; - typedef index::DocIdAndFeatures DocIdAndFeatures; - typedef index::PostingListParams PostingListParams; + using ParentClass = EGPosOccDecodeContext<bigEndian>; + using DocIdAndFeatures = index::DocIdAndFeatures; + using PostingListParams = index::PostingListParams; using ParentClass::smallAlign; using ParentClass::readBits; using ParentClass::_valI; @@ -251,7 +251,7 @@ public: using ParentClass::_fileReadBias; using ParentClass::_readContext; using ParentClass::_fieldsParams; - typedef EncodeContext64<bigEndian> EC; + using EC = EncodeContext64<bigEndian>; EGPosOccDecodeContextCooked(const PosOccFieldsParams *fieldsParams) : EGPosOccDecodeContext<bigEndian>(fieldsParams) @@ -291,9 +291,9 @@ template <bool bigEndian> class EGPosOccEncodeContext : public EG2PosOccEncodeContext<bigEndian> { public: - typedef EG2PosOccEncodeContext<bigEndian> ParentClass; - typedef index::DocIdAndFeatures DocIdAndFeatures; - typedef index::PostingListParams PostingListParams; + using ParentClass = EG2PosOccEncodeContext<bigEndian>; + using DocIdAndFeatures = index::DocIdAndFeatures; + using PostingListParams = index::PostingListParams; using ParentClass::smallAlign; using ParentClass::writeBits; using ParentClass::_valI; diff --git a/searchlib/src/vespa/searchlib/common/bitvectorcache.h b/searchlib/src/vespa/searchlib/common/bitvectorcache.h index 5f8edf29854..6fac1352d94 100644 --- a/searchlib/src/vespa/searchlib/common/bitvectorcache.h +++ b/searchlib/src/vespa/searchlib/common/bitvectorcache.h @@ -13,7 +13,7 @@ class PopulateInterface public: class Iterator { public: - typedef std::unique_ptr<Iterator> UP; + using UP = std::unique_ptr<Iterator>; virtual ~Iterator() { } virtual int32_t getNext() = 0; }; @@ -24,11 +24,11 @@ public: class BitVectorCache { public: - typedef uint64_t Key; - typedef vespalib::hash_set<Key> KeySet; - typedef std::vector<std::pair<Key, size_t>> KeyAndCountSet; - typedef CondensedBitVector::CountVector CountVector; - typedef vespalib::GenerationHolder GenerationHolder; + using Key = uint64_t; + using KeySet = vespalib::hash_set<Key>; + using KeyAndCountSet = std::vector<std::pair<Key, size_t>>; + using CountVector = CondensedBitVector::CountVector; + using GenerationHolder = vespalib::GenerationHolder; BitVectorCache(GenerationHolder &genHolder); ~BitVectorCache(); @@ -69,9 +69,9 @@ private: int32_t _chunkId; uint32_t _chunkIndex; }; - typedef vespalib::hash_map<Key, KeyMeta> Key2Index; - typedef std::vector<std::pair<Key, KeyMeta *>> SortedKeyMeta; - typedef std::vector<CondensedBitVector::SP> ChunkV; + using Key2Index = vespalib::hash_map<Key, KeyMeta>; + using SortedKeyMeta = std::vector<std::pair<Key, KeyMeta *>>; + using ChunkV = std::vector<CondensedBitVector::SP>; VESPA_DLL_LOCAL static SortedKeyMeta getSorted(Key2Index & keys); VESPA_DLL_LOCAL static void populate(Key2Index & newKeys, CondensedBitVector & chunk, const PopulateInterface & lookup); diff --git a/searchlib/src/vespa/searchlib/common/bitword.h b/searchlib/src/vespa/searchlib/common/bitword.h index d90ec9c93d3..cba6cf7723f 100644 --- a/searchlib/src/vespa/searchlib/common/bitword.h +++ b/searchlib/src/vespa/searchlib/common/bitword.h @@ -10,8 +10,8 @@ namespace search { class BitWord { public: - typedef uint64_t Word; - typedef uint32_t Index; + using Word = uint64_t; + using Index = uint32_t; static Word checkTab(Index index) { return _checkTab[bitNum(index)]; } static Word startBits(Index index) { return (std::numeric_limits<Word>::max() >> 1) >> (WordLen - 1 - bitNum(index)); } static constexpr size_t WordLen = sizeof(Word)*8; diff --git a/searchlib/src/vespa/searchlib/common/condensedbitvectors.h b/searchlib/src/vespa/searchlib/common/condensedbitvectors.h index 696400eb7a1..49b346355a9 100644 --- a/searchlib/src/vespa/searchlib/common/condensedbitvectors.h +++ b/searchlib/src/vespa/searchlib/common/condensedbitvectors.h @@ -10,11 +10,11 @@ namespace search { class CondensedBitVector { public: - typedef std::unique_ptr<CondensedBitVector> UP; - typedef std::shared_ptr<CondensedBitVector> SP; - typedef uint32_t Key; - typedef std::set<Key> KeySet; - typedef vespalib::ArrayRef<uint8_t> CountVector; + using UP = std::unique_ptr<CondensedBitVector>; + using SP = std::shared_ptr<CondensedBitVector>; + using Key = uint32_t; + using KeySet = std::set<Key>; + using CountVector = vespalib::ArrayRef<uint8_t>; virtual ~CondensedBitVector(); diff --git a/searchlib/src/vespa/searchlib/common/feature.h b/searchlib/src/vespa/searchlib/common/feature.h index e52cc9e0a9d..fc1bdb48569 100644 --- a/searchlib/src/vespa/searchlib/common/feature.h +++ b/searchlib/src/vespa/searchlib/common/feature.h @@ -4,7 +4,7 @@ namespace search { -typedef double feature_t; +using feature_t = double; } // namespace search diff --git a/searchlib/src/vespa/searchlib/common/featureset.cpp b/searchlib/src/vespa/searchlib/common/featureset.cpp index a03befed4a2..5c8d4c6d9c4 100644 --- a/searchlib/src/vespa/searchlib/common/featureset.cpp +++ b/searchlib/src/vespa/searchlib/common/featureset.cpp @@ -41,7 +41,7 @@ FeatureSet::addDocId(uint32_t docId) bool FeatureSet::contains(const std::vector<uint32_t> &docIds) const { - typedef std::vector<uint32_t>::const_iterator ITR; + using ITR = std::vector<uint32_t>::const_iterator; ITR myPos = _docIds.begin(); ITR myEnd = _docIds.end(); ITR pos = docIds.begin(); diff --git a/searchlib/src/vespa/searchlib/common/featureset.h b/searchlib/src/vespa/searchlib/common/featureset.h index 1415d4b48ef..adda8a2728b 100644 --- a/searchlib/src/vespa/searchlib/common/featureset.h +++ b/searchlib/src/vespa/searchlib/common/featureset.h @@ -40,8 +40,8 @@ public: } }; - typedef vespalib::string string; - typedef std::vector<string> StringVector; + using string = vespalib::string; + using StringVector = std::vector<string>; private: StringVector _names; std::vector<uint32_t> _docIds; diff --git a/searchlib/src/vespa/searchlib/common/fileheadercontext.cpp b/searchlib/src/vespa/searchlib/common/fileheadercontext.cpp index 1b1c4d310fd..9f7773f4db2 100644 --- a/searchlib/src/vespa/searchlib/common/fileheadercontext.cpp +++ b/searchlib/src/vespa/searchlib/common/fileheadercontext.cpp @@ -17,7 +17,7 @@ FileHeaderContext::~FileHeaderContext() = default; void FileHeaderContext::addCreateAndFreezeTime(GenericHeader &header) { - typedef GenericHeader::Tag Tag; + using Tag = GenericHeader::Tag; header.putTag(Tag("createTime", duration_cast<microseconds>(system_clock::now().time_since_epoch()).count())); header.putTag(Tag("freezeTime", 0)); } @@ -25,7 +25,7 @@ FileHeaderContext::addCreateAndFreezeTime(GenericHeader &header) void FileHeaderContext::setFreezeTime(GenericHeader &header) { - typedef GenericHeader::Tag Tag; + using Tag = GenericHeader::Tag; if (header.hasTag("freezeTime") && header.getTag("freezeTime").getType() == Tag::TYPE_INTEGER) { header.putTag(Tag("freezeTime", duration_cast<microseconds>(system_clock::now().time_since_epoch()).count())); diff --git a/searchlib/src/vespa/searchlib/common/hitrank.h b/searchlib/src/vespa/searchlib/common/hitrank.h index 092855878c2..4acb73accd1 100644 --- a/searchlib/src/vespa/searchlib/common/hitrank.h +++ b/searchlib/src/vespa/searchlib/common/hitrank.h @@ -6,7 +6,7 @@ namespace search { -typedef double HitRank; +using HitRank = double; constexpr HitRank default_rank_value = -HUGE_VAL; constexpr HitRank zero_rank_value = 0.0; diff --git a/searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h b/searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h index a10a85331a6..bb0583972d4 100644 --- a/searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h +++ b/searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h @@ -19,7 +19,7 @@ struct IDocumentMetaStoreContext { */ struct IReadGuard { - typedef std::unique_ptr<IReadGuard> UP; + using UP = std::unique_ptr<IReadGuard>; virtual ~IReadGuard() {} diff --git a/searchlib/src/vespa/searchlib/common/idocumentmetastore.h b/searchlib/src/vespa/searchlib/common/idocumentmetastore.h index 0ad7f65f5c1..66b4905ea64 100644 --- a/searchlib/src/vespa/searchlib/common/idocumentmetastore.h +++ b/searchlib/src/vespa/searchlib/common/idocumentmetastore.h @@ -14,14 +14,14 @@ namespace search { * Meta data for a single document. **/ struct DocumentMetaData { - typedef uint32_t DocId; + using DocId = uint32_t; DocId lid; uint64_t timestamp; document::BucketId bucketId; document::GlobalId gid; bool removed; - typedef std::vector<DocumentMetaData> Vector; + using Vector = std::vector<DocumentMetaData>; DocumentMetaData() noexcept : lid(0), @@ -70,10 +70,10 @@ class IGidToLidMapperVisitor; * meta data per document. **/ struct IDocumentMetaStore { - typedef uint32_t DocId; - typedef document::GlobalId GlobalId; - typedef document::BucketId BucketId; - typedef uint64_t Timestamp; + using DocId = uint32_t; + using GlobalId = document::GlobalId; + using BucketId = document::BucketId; + using Timestamp = uint64_t; virtual ~IDocumentMetaStore() = default; diff --git a/searchlib/src/vespa/searchlib/common/indexmetainfo.h b/searchlib/src/vespa/searchlib/common/indexmetainfo.h index 2ba8bebb698..191f11abe0e 100644 --- a/searchlib/src/vespa/searchlib/common/indexmetainfo.h +++ b/searchlib/src/vespa/searchlib/common/indexmetainfo.h @@ -27,8 +27,8 @@ public: return syncToken < rhs.syncToken; } }; - typedef std::vector<Snapshot> SnapshotList; - typedef SnapshotList::iterator SnapItr; + using SnapshotList = std::vector<Snapshot>; + using SnapItr = SnapshotList::iterator; private: vespalib::string _path; diff --git a/searchlib/src/vespa/searchlib/common/packets.h b/searchlib/src/vespa/searchlib/common/packets.h index f4e38b7f0cc..d3298f7a02d 100644 --- a/searchlib/src/vespa/searchlib/common/packets.h +++ b/searchlib/src/vespa/searchlib/common/packets.h @@ -39,9 +39,9 @@ public: class FS4Properties { private: - typedef std::pair<uint32_t, uint32_t> StringRef; - typedef std::pair<StringRef, StringRef> Entry; - typedef std::vector<Entry> KeyValueVector; + using StringRef = std::pair<uint32_t, uint32_t>; + using Entry = std::pair<StringRef, StringRef>; + using KeyValueVector = std::vector<Entry>; KeyValueVector _entries; vespalib::string _name; diff --git a/searchlib/src/vespa/searchlib/common/serialnum.h b/searchlib/src/vespa/searchlib/common/serialnum.h index 5a7ee4b2700..eff9881cb35 100644 --- a/searchlib/src/vespa/searchlib/common/serialnum.h +++ b/searchlib/src/vespa/searchlib/common/serialnum.h @@ -7,7 +7,7 @@ namespace search { // This is a unique identification number. -typedef uint64_t SerialNum; +using SerialNum = uint64_t; } // namespace search diff --git a/searchlib/src/vespa/searchlib/common/serialnumfileheadercontext.cpp b/searchlib/src/vespa/searchlib/common/serialnumfileheadercontext.cpp index ddd8bbdb250..a548aa234e2 100644 --- a/searchlib/src/vespa/searchlib/common/serialnumfileheadercontext.cpp +++ b/searchlib/src/vespa/searchlib/common/serialnumfileheadercontext.cpp @@ -21,7 +21,7 @@ SerialNumFileHeaderContext::addTags(vespalib::GenericHeader &header, const vespalib::string &name) const { _parentFileHeaderContext.addTags(header, name); - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; if (_serialNum != 0u) header.putTag(Tag("serialNum", _serialNum)); } diff --git a/searchlib/src/vespa/searchlib/common/sort.h b/searchlib/src/vespa/searchlib/common/sort.h index 4f0d285f1c7..bfe98194dcc 100644 --- a/searchlib/src/vespa/searchlib/common/sort.h +++ b/searchlib/src/vespa/searchlib/common/sort.h @@ -294,7 +294,7 @@ public: static size_t radix_sort(GR R, GE E, T * a, size_t n, unsigned int insertSortLevel=10, size_t topn=std::numeric_limits<size_t>::max()); static size_t radix_sort_internal(GR R, GE E, T * a, size_t n, unsigned int insertSortLevel, size_t topn); private: - typedef ShiftBasedRadixSorterBase<GR, T, SHIFT> Base; + using Base = ShiftBasedRadixSorterBase<GR, T, SHIFT>; }; template<typename T, typename GR, typename GE, int SHIFT, bool continueAfterRadixEnds> @@ -365,7 +365,7 @@ template<typename T, bool asc=true> class NumericRadixSorter { public: - typedef vespalib::convertForSort<T, asc> C; + using C = vespalib::convertForSort<T, asc>; class RadixSortable { public: typename C::UIntType operator () (typename C::InputType v) const { return C::convert(v); } diff --git a/searchlib/src/vespa/searchlib/common/sortresults.cpp b/searchlib/src/vespa/searchlib/common/sortresults.cpp index a09845f3330..e1b3d6cc0e6 100644 --- a/searchlib/src/vespa/searchlib/common/sortresults.cpp +++ b/searchlib/src/vespa/searchlib/common/sortresults.cpp @@ -27,7 +27,7 @@ template<typename T> class RadixHelper { public: - typedef convertForSort<T, true> C; + using C = convertForSort<T, true>; inline typename C::UIntType operator()(typename C::InputType v) const { return C::convert(v); @@ -38,7 +38,7 @@ void insertion_sort(RankedHit a[], uint32_t n) { uint32_t i, j; RankedHit swap; - typedef RadixHelper<search::HitRank> RT; + using RT = RadixHelper<search::HitRank>; RT R; for (i = 1; i < n; i++) { @@ -62,7 +62,7 @@ FastS_radixsort(RankedHit a[], uint32_t n, uint32_t ntop) uint32_t sorted, remain; uint32_t i, j, k; RankedHit temp, swap; - typedef RadixHelper<search::HitRank> RT; + using RT = RadixHelper<search::HitRank>; RT R; memset(cnt, 0, 256*sizeof(uint32_t)); diff --git a/searchlib/src/vespa/searchlib/common/tunefileinfo.h b/searchlib/src/vespa/searchlib/common/tunefileinfo.h index f336e6e0bfb..8466252306a 100644 --- a/searchlib/src/vespa/searchlib/common/tunefileinfo.h +++ b/searchlib/src/vespa/searchlib/common/tunefileinfo.h @@ -242,7 +242,7 @@ public: class TuneFileDocumentDB { public: - typedef std::shared_ptr<TuneFileDocumentDB> SP; + using SP = std::shared_ptr<TuneFileDocumentDB>; TuneFileIndexManager _index; TuneFileAttributes _attr; diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectordictionary.h b/searchlib/src/vespa/searchlib/diskindex/bitvectordictionary.h index b1e5ca55a15..9f827fb0086 100644 --- a/searchlib/src/vespa/searchlib/diskindex/bitvectordictionary.h +++ b/searchlib/src/vespa/searchlib/diskindex/bitvectordictionary.h @@ -18,7 +18,7 @@ namespace search::diskindex { class BitVectorDictionary { private: - typedef search::index::BitVectorWordSingleKey WordSingleKey; + using WordSingleKey = search::index::BitVectorWordSingleKey; uint32_t _docIdLimit; std::vector<WordSingleKey> _entries; @@ -27,7 +27,7 @@ private: uint32_t _datHeaderLen; public: - typedef std::shared_ptr<BitVectorDictionary> SP; + using SP = std::shared_ptr<BitVectorDictionary>; BitVectorDictionary(const BitVectorDictionary &rhs) = delete; BitVectorDictionary &operator=(const BitVectorDictionary &rhs) = delete; BitVectorDictionary(); diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp b/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp index 70309645ee2..4ae0ce2621a 100644 --- a/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp @@ -88,7 +88,7 @@ void BitVectorFileWrite::makeDatHeader(const FileHeaderContext &fileHeaderContext) { vespalib::FileHeader h(FileSettings::DIRECTIO_ALIGNMENT); - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; fileHeaderContext.addTags(h, _datFile->GetFileName()); h.putTag(Tag("docIdLimit", _docIdLimit)); h.putTag(Tag("numKeys", _numKeys)); @@ -105,7 +105,7 @@ void BitVectorFileWrite::updateDatHeader(uint64_t fileBitSize) { vespalib::FileHeader h(FileSettings::DIRECTIO_ALIGNMENT); - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; readHeader(h, _datFile->GetFileName()); FileHeaderContext::setFreezeTime(h); h.putTag(Tag("numKeys", _numKeys)); diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp index e87238bef2d..6913c03262c 100644 --- a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp @@ -89,7 +89,7 @@ void BitVectorIdxFileWrite::makeIdxHeader(const FileHeaderContext &fileHeaderContext) { vespalib::FileHeader h(FileSettings::DIRECTIO_ALIGNMENT); - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; fileHeaderContext.addTags(h, _idxFile->GetFileName()); h.putTag(Tag("docIdLimit", _docIdLimit)); h.putTag(Tag("numKeys", _numKeys)); @@ -107,7 +107,7 @@ void BitVectorIdxFileWrite::updateIdxHeader(uint64_t fileBitSize) { vespalib::FileHeader h(FileSettings::DIRECTIO_ALIGNMENT); - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; readHeader(h, _idxFile->GetFileName()); FileHeaderContext::setFreezeTime(h); h.putTag(Tag("numKeys", _numKeys)); diff --git a/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp b/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp index 7e8ad4d2f0b..99107749610 100644 --- a/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp @@ -356,7 +356,7 @@ public: } private: - typedef vespalib::hash_map<vespalib::string, DiskIndex::LookupResultVector> Cache; + using Cache = vespalib::hash_map<vespalib::string, DiskIndex::LookupResultVector>; DiskIndex & _diskIndex; const std::vector<uint32_t> & _fieldIds; Cache _cache; diff --git a/searchlib/src/vespa/searchlib/diskindex/diskindex.h b/searchlib/src/vespa/searchlib/diskindex/diskindex.h index f1a294f90ef..faa562e5809 100644 --- a/searchlib/src/vespa/searchlib/diskindex/diskindex.h +++ b/searchlib/src/vespa/searchlib/diskindex/diskindex.h @@ -30,7 +30,7 @@ public: uint64_t wordNum; index::PostingListCounts counts; uint64_t bitOffset; - typedef std::unique_ptr<LookupResult> UP; + using UP = std::unique_ptr<LookupResult>; LookupResult() noexcept; bool valid() const { return counts._numDocs > 0; } void swap(LookupResult & rhs) { @@ -40,8 +40,8 @@ public: std::swap(bitOffset , rhs.bitOffset); } }; - typedef std::vector<LookupResult> LookupResultVector; - typedef std::vector<uint32_t> IndexList; + using LookupResultVector = std::vector<LookupResult>; + using IndexList = std::vector<uint32_t>; class Key { public: diff --git a/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp b/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp index 1794db8bba3..d01030ee975 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp @@ -317,7 +317,7 @@ FieldReaderStripInfo::scan_element_lengths(uint32_t scan_chunk) void FieldReaderStripInfo::read() { - typedef search::index::WordDocElementFeatures Element; + using Element = search::index::WordDocElementFeatures; for (;;) { FieldReader::read(); diff --git a/searchlib/src/vespa/searchlib/diskindex/fieldreader.h b/searchlib/src/vespa/searchlib/diskindex/fieldreader.h index 75c8d35740e..c822ace0002 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fieldreader.h +++ b/searchlib/src/vespa/searchlib/diskindex/fieldreader.h @@ -33,12 +33,12 @@ private: public: using DictionaryFileSeqRead = index::DictionaryFileSeqRead; - typedef index::PostingListFileSeqRead PostingListFileSeqRead; - typedef index::DocIdAndFeatures DocIdAndFeatures; - typedef index::Schema Schema; - typedef index::SchemaUtil::IndexIterator IndexIterator; - typedef index::PostingListCounts PostingListCounts; - typedef index::PostingListParams PostingListParams; + using PostingListFileSeqRead = index::PostingListFileSeqRead; + using DocIdAndFeatures = index::DocIdAndFeatures; + using Schema = index::Schema; + using IndexIterator = index::SchemaUtil::IndexIterator; + using PostingListCounts = index::PostingListCounts; + using PostingListParams = index::PostingListParams; uint64_t _wordNum; DocIdAndFeatures _docIdAndFeatures; diff --git a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h index f74ee0c1bb3..c29bbe2e28f 100644 --- a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h +++ b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h @@ -48,7 +48,7 @@ private: } public: - typedef index::WordDocElementWordPosFeatures WordDocElementWordPosFeatures; + using WordDocElementWordPosFeatures = index::WordDocElementWordPosFeatures; // Schema argument must live until IndexBuilder has been deleted. IndexBuilder(const Schema &schema); diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp index 4462c90f4c5..b90fdbe329f 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp @@ -354,7 +354,7 @@ PageDict4FileSeqWrite::close() void PageDict4FileSeqWrite::DictFileContext::writeExtendedHeader(vespalib::GenericHeader &header) { - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; header.putTag(Tag("numWordIds", _ec._numWordIds)); header.putTag(Tag("avgBitsPerDoc", _ec._avgBitsPerDoc)); header.putTag(Tag("minChunkDocs", _ec._minChunkDocs)); @@ -364,7 +364,7 @@ PageDict4FileSeqWrite::DictFileContext::writeExtendedHeader(vespalib::GenericHea void PageDict4FileSeqWrite::DictFileContext::makeHeader(const FileHeaderContext &fileHeaderContext) { - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; vespalib::FileHeader header(FileSettings::DIRECTIO_ALIGNMENT); fileHeaderContext.addTags(header, _file.GetFileName()); @@ -398,7 +398,7 @@ PageDict4FileSeqWrite::DictFileContext::updateHeader(uint64_t fileBitSize, uint6 f.OpenReadWrite(_file.GetFileName()); h.readFile(f); FileHeaderContext::setFreezeTime(h); - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; h.putTag(Tag("frozen", 1)); h.putTag(Tag("fileBitSize", fileBitSize)); if (_extended) { diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.h b/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.h index f2c6bc79d1b..189e342c61a 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.h +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.h @@ -11,16 +11,16 @@ namespace search::diskindex { class PageDict4RandRead : public index::DictionaryFileRandRead { - typedef bitcompression::PostingListCountFileDecodeContext DC; - typedef bitcompression::PageDict4SSReader SSReader; + using DC = bitcompression::PostingListCountFileDecodeContext; + using SSReader = bitcompression::PageDict4SSReader; - typedef bitcompression::PageDict4SSLookupRes SSLookupRes; - typedef bitcompression::PageDict4SPLookupRes SPLookupRes; - typedef bitcompression::PageDict4PLookupRes PLookupRes; - typedef bitcompression::PageDict4PageParams PageDict4PageParams; + using SSLookupRes = bitcompression::PageDict4SSLookupRes; + using SPLookupRes = bitcompression::PageDict4SPLookupRes; + using PLookupRes = bitcompression::PageDict4PLookupRes; + using PageDict4PageParams = bitcompression::PageDict4PageParams; - typedef index::PostingListCounts PostingListCounts; - typedef index::PostingListOffsetAndCounts PostingListOffsetAndCounts; + using PostingListCounts = index::PostingListCounts; + using PostingListOffsetAndCounts = index::PostingListOffsetAndCounts; std::unique_ptr<SSReader> _ssReader; diff --git a/searchlib/src/vespa/searchlib/diskindex/wordnummapper.h b/searchlib/src/vespa/searchlib/diskindex/wordnummapper.h index 4f6201aeef8..fee505e2c69 100644 --- a/searchlib/src/vespa/searchlib/diskindex/wordnummapper.h +++ b/searchlib/src/vespa/searchlib/diskindex/wordnummapper.h @@ -12,7 +12,7 @@ class WordNumMapper; class WordNumMapping { - typedef vespalib::Array<uint64_t> Array; + using Array = vespalib::Array<uint64_t>; static uint64_t noWordNumHigh() { return std::numeric_limits<uint64_t>::max(); diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposocc.h b/searchlib/src/vespa/searchlib/diskindex/zcposocc.h index cbb5e6da039..c5d1b9e2584 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposocc.h +++ b/searchlib/src/vespa/searchlib/diskindex/zcposocc.h @@ -30,7 +30,7 @@ private: bitcompression::EG2PosOccEncodeContext<true> _realEncodeFeatures; public: - typedef index::Schema Schema; + using Schema = index::Schema; Zc4PosOccSeqWrite(const Schema &schema, uint32_t indexId, const index::FieldLengthInfo &field_length_info, @@ -58,7 +58,7 @@ private: bitcompression::PosOccFieldsParams _fieldsParams; bitcompression::EGPosOccEncodeContext<true> _realEncodeFeatures; public: - typedef index::Schema Schema; + using Schema = index::Schema; ZcPosOccSeqWrite(const Schema &schema, uint32_t indexId, const index::FieldLengthInfo &field_length_info, index::PostingListCountFileSeqWrite *countFile); diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposocciterators.h b/searchlib/src/vespa/searchlib/diskindex/zcposocciterators.h index 7e60c2df112..00847b3d561 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposocciterators.h +++ b/searchlib/src/vespa/searchlib/diskindex/zcposocciterators.h @@ -31,7 +31,7 @@ template <bool bigEndian, bool dynamic_k> class ZcPosOccIterator : public ZcPostingIterator<bigEndian> { private: - typedef ZcPostingIterator<bigEndian> ParentClass; + using ParentClass = ZcPostingIterator<bigEndian>; using ParentClass::_decodeContext; using DecodeContext = std::conditional_t<dynamic_k, bitcompression::EGPosOccDecodeContextCooked<bigEndian>, bitcompression::EG2PosOccDecodeContextCooked<bigEndian>>; diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.h b/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.h index bcc42374cd3..f23af15f72d 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.h +++ b/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.h @@ -26,8 +26,8 @@ public: ZcPosOccRandRead(); ~ZcPosOccRandRead(); - typedef index::PostingListCounts PostingListCounts; - typedef index::PostingListHandle PostingListHandle; + using PostingListCounts = index::PostingListCounts; + using PostingListHandle = index::PostingListHandle; /** * Create iterator for single word. Semantic lifetime of counts and diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp b/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp index 1f399971406..ef540365208 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp @@ -227,7 +227,7 @@ Zc4PostingSeqWrite::makeHeader(const FileHeaderContext &fileHeaderContext) const vespalib::string &myId = _writer.get_dynamic_k() ? myId5 : myId4; vespalib::FileHeader header; - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; fileHeaderContext.addTags(header, _file.GetFileName()); header.putTag(Tag("frozen", 0)); header.putTag(Tag("fileBitSize", 0)); @@ -261,7 +261,7 @@ Zc4PostingSeqWrite::updateHeader() f.OpenReadWrite(_file.GetFileName()); h.readFile(f); FileHeaderContext::setFreezeTime(h); - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; h.putTag(Tag("frozen", 1)); h.putTag(Tag("fileBitSize", _fileBitSize)); h.putTag(Tag("numWords", _writer.get_num_words())); diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposting.h b/searchlib/src/vespa/searchlib/diskindex/zcposting.h index 3d7dee1a988..94606b9708d 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposting.h +++ b/searchlib/src/vespa/searchlib/diskindex/zcposting.h @@ -32,9 +32,9 @@ public: ~Zc4PostingSeqRead(); - typedef index::DocIdAndFeatures DocIdAndFeatures; - typedef index::PostingListCounts PostingListCounts; - typedef index::PostingListParams PostingListParams; + using DocIdAndFeatures = index::DocIdAndFeatures; + using PostingListCounts = index::PostingListCounts; + using PostingListParams = index::PostingListParams; void readDocIdAndFeatures(DocIdAndFeatures &features) override; void readCounts(const PostingListCounts &counts) override; // Fill in for next word @@ -53,7 +53,7 @@ class Zc4PostingSeqWrite : public index::PostingListFileSeqWrite Zc4PostingSeqWrite &operator=(const Zc4PostingSeqWrite &); protected: - typedef bitcompression::FeatureEncodeContextBE EncodeContext; + using EncodeContext = bitcompression::FeatureEncodeContextBE; Zc4PostingWriter<true> _writer; FastOS_File _file; @@ -68,9 +68,9 @@ public: Zc4PostingSeqWrite(index::PostingListCountFileSeqWrite *countFile); ~Zc4PostingSeqWrite(); - typedef index::DocIdAndFeatures DocIdAndFeatures; - typedef index::PostingListCounts PostingListCounts; - typedef index::PostingListParams PostingListParams; + using DocIdAndFeatures = index::DocIdAndFeatures; + using PostingListCounts = index::PostingListCounts; + using PostingListParams = index::PostingListParams; void writeDocIdAndFeatures(const DocIdAndFeatures &features) override; void flushWord() override; diff --git a/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.cpp b/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.cpp index 6af0ebb6199..66404c7a0ff 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.cpp @@ -70,7 +70,7 @@ template <bool bigEndian, bool dynamic_k> void ZcRareWordPostingIterator<bigEndian, dynamic_k>::doSeek(uint32_t docId) { - typedef FeatureEncodeContext<bigEndian> EC; + using EC = FeatureEncodeContext<bigEndian>; uint32_t length; uint64_t val64; @@ -163,7 +163,7 @@ void ZcRareWordPostingIterator<bigEndian, dynamic_k>::readWordStart(uint32_t docIdLimit) { (void) docIdLimit; - typedef FeatureEncodeContext<bigEndian> EC; + using EC = FeatureEncodeContext<bigEndian>; UC64_DECODECONTEXT_CONSTRUCTOR(o, _decodeContext->_); uint32_t length; uint64_t val64; @@ -238,7 +238,7 @@ template <bool bigEndian> void ZcPostingIterator<bigEndian>::readWordStart(uint32_t docIdLimit) { - typedef FeatureEncodeContext<bigEndian> EC; + using EC = FeatureEncodeContext<bigEndian>; DecodeContextBase &d = *_decodeContext; UC64_DECODECONTEXT_CONSTRUCTOR(o, d._); uint32_t length; diff --git a/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h b/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h index 36375a25d2b..c57870baab2 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h +++ b/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h @@ -58,11 +58,11 @@ template <bool bigEndian> class ZcRareWordPostingIteratorBase : public ZcIteratorBase { private: - typedef ZcIteratorBase ParentClass; + using ParentClass = ZcIteratorBase; public: - typedef bitcompression::FeatureDecodeContext<bigEndian> DecodeContextBase; - typedef index::DocIdAndFeatures DocIdAndFeatures; + using DecodeContextBase = bitcompression::FeatureDecodeContext<bigEndian>; + using DocIdAndFeatures = index::DocIdAndFeatures; DecodeContextBase *_decodeContext; unsigned int _residue; uint32_t _prevDocId; // Previous document id @@ -308,14 +308,14 @@ template <bool bigEndian> class ZcPostingIterator : public ZcPostingIteratorBase { private: - typedef ZcPostingIteratorBase ParentClass; + using ParentClass = ZcPostingIteratorBase; using ParentClass::getDocId; public: - typedef bitcompression::FeatureDecodeContext<bigEndian> DecodeContextBase; - typedef index::DocIdAndFeatures DocIdAndFeatures; - typedef index::PostingListCounts PostingListCounts; + using DecodeContextBase = bitcompression::FeatureDecodeContext<bigEndian>; + using DocIdAndFeatures = index::DocIdAndFeatures; + using PostingListCounts = index::PostingListCounts; DecodeContextBase *_decodeContext; uint32_t _minChunkDocs; uint32_t _docIdK; diff --git a/searchlib/src/vespa/searchlib/docstore/chunk.h b/searchlib/src/vespa/searchlib/docstore/chunk.h index 40600663106..158d754eb9a 100644 --- a/searchlib/src/vespa/searchlib/docstore/chunk.h +++ b/searchlib/src/vespa/searchlib/docstore/chunk.h @@ -85,7 +85,7 @@ public: uint32_t _sz; uint32_t _offset; }; - typedef std::vector<Entry> LidList; + using LidList = std::vector<Entry>; Chunk(uint32_t id, const Config & config); Chunk(uint32_t id, const void * buffer, size_t len, bool skipcrc=false); ~Chunk(); @@ -116,7 +116,7 @@ private: mutable std::mutex _lock; }; -typedef std::vector<ChunkMeta> ChunkMetaV; +using ChunkMetaV = std::vector<ChunkMeta>; } // namespace search diff --git a/searchlib/src/vespa/searchlib/docstore/filechunk.cpp b/searchlib/src/vespa/searchlib/docstore/filechunk.cpp index d3b84ed89ae..a280ae08b46 100644 --- a/searchlib/src/vespa/searchlib/docstore/filechunk.cpp +++ b/searchlib/src/vespa/searchlib/docstore/filechunk.cpp @@ -130,7 +130,7 @@ public: } }; -typedef vespalib::Array<TmpChunkMeta> TmpChunkMetaV; +using TmpChunkMetaV = vespalib::Array<TmpChunkMeta>; namespace { diff --git a/searchlib/src/vespa/searchlib/docstore/filechunk.h b/searchlib/src/vespa/searchlib/docstore/filechunk.h index af5690e8569..8788430a5df 100644 --- a/searchlib/src/vespa/searchlib/docstore/filechunk.h +++ b/searchlib/src/vespa/searchlib/docstore/filechunk.h @@ -29,7 +29,7 @@ class DataStoreFileChunkStats; class IWriteData { public: - typedef std::unique_ptr<IWriteData> UP; + using UP = std::unique_ptr<IWriteData>; using LockGuard = std::unique_lock<std::mutex>; virtual ~IWriteData() = default; @@ -103,9 +103,9 @@ public: private: int32_t _id; }; - typedef vespalib::hash_map<uint32_t, std::unique_ptr<vespalib::DataBuffer>> LidBufferMap; - typedef std::unique_ptr<FileChunk> UP; - typedef uint32_t SubChunkId; + using LidBufferMap = vespalib::hash_map<uint32_t, std::unique_ptr<vespalib::DataBuffer>>; + using UP = std::unique_ptr<FileChunk>; + using SubChunkId = uint32_t; FileChunk(FileId fileId, NameId nameId, const vespalib::string &baseName, const TuneFileSummary &tune, const IBucketizer *bucketizer, bool skipCrcOnRead); virtual ~FileChunk(); @@ -201,7 +201,7 @@ public: static vespalib::string createIdxFileName(const vespalib::string & name); static vespalib::string createDatFileName(const vespalib::string & name); private: - typedef std::unique_ptr<FileRandRead> File; + using File = std::unique_ptr<FileRandRead>; void loadChunkInfo(); const FileId _fileId; const NameId _nameId; @@ -240,7 +240,7 @@ protected: static uint32_t readDocIdLimit(vespalib::GenericHeader &header); static void writeDocIdLimit(vespalib::GenericHeader &header, uint32_t docIdLimit); - typedef vespalib::Array<ChunkInfo> ChunkInfoVector; + using ChunkInfoVector = vespalib::Array<ChunkInfo>; const IBucketizer * _bucketizer; size_t _addedBytes; TuneFileSummary _tune; diff --git a/searchlib/src/vespa/searchlib/docstore/ibucketizer.h b/searchlib/src/vespa/searchlib/docstore/ibucketizer.h index 4b7ddd0bc05..b7b55974978 100644 --- a/searchlib/src/vespa/searchlib/docstore/ibucketizer.h +++ b/searchlib/src/vespa/searchlib/docstore/ibucketizer.h @@ -11,7 +11,7 @@ namespace search { class IBucketizer { public: - typedef std::shared_ptr<IBucketizer> SP; + using SP = std::shared_ptr<IBucketizer>; virtual ~IBucketizer() { } virtual document::BucketId getBucketOf(const vespalib::GenerationHandler::Guard & guard, uint32_t lid) const = 0; virtual vespalib::GenerationHandler::Guard getGuard() const = 0; diff --git a/searchlib/src/vespa/searchlib/docstore/idatastore.h b/searchlib/src/vespa/searchlib/docstore/idatastore.h index 442614dfdae..2fe3ebc00e4 100644 --- a/searchlib/src/vespa/searchlib/docstore/idatastore.h +++ b/searchlib/src/vespa/searchlib/docstore/idatastore.h @@ -39,7 +39,7 @@ public: class IDataStore : public common::ICompactableLidSpace { public: - typedef std::vector<uint32_t> LidVector; + using LidVector = std::vector<uint32_t>; /** * Construct an idata store. * A data store has a base directory. The rest is up to the implementation. diff --git a/searchlib/src/vespa/searchlib/docstore/lid_info.h b/searchlib/src/vespa/searchlib/docstore/lid_info.h index 86814102610..24bc6a59664 100644 --- a/searchlib/src/vespa/searchlib/docstore/lid_info.h +++ b/searchlib/src/vespa/searchlib/docstore/lid_info.h @@ -63,7 +63,7 @@ private: uint32_t _lid; }; -typedef std::vector<LidInfoWithLid> LidInfoWithLidV; +using LidInfoWithLidV = std::vector<LidInfoWithLid>; class ISetLid { diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp index 381bf0715b0..174b6b92cd5 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp +++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp @@ -338,7 +338,7 @@ LogDataStore::initFlush(uint64_t syncToken) std::pair<bool, LogDataStore::FileId> LogDataStore::findNextToCompact(bool dueToBloat) { - typedef std::multimap<double, FileId, std::greater<double>> CostMap; + using CostMap = std::multimap<double, FileId, std::greater<double>>; CostMap worst; MonitorGuard guard(_updateLock); for (size_t i(0); i < _fileChunks.size(); i++) { @@ -775,7 +775,7 @@ LogDataStore::preload() if (!partList.empty()) { verifyModificationTime(partList); partList = scanDir(getBaseDir(), ".idx"); - typedef NameIdSet::const_iterator It; + using It = NameIdSet::const_iterator; for (It it(partList.begin()), mt(--partList.end()); it != mt; it++) { _fileChunks.push_back(createReadOnlyFile(FileId(_fileChunks.size()), *it)); } @@ -867,7 +867,7 @@ LogDataStore::eraseIncompleteCompactedFiles(NameIdSet partList) void LogDataStore::eraseDanglingDatFiles(const NameIdSet &partList, const NameIdSet &datPartList) { - typedef NameIdSet::const_iterator IT; + using IT = NameIdSet::const_iterator; IT iib(partList.begin()); IT ii(iib); diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.h b/searchlib/src/vespa/searchlib/docstore/logdatastore.h index 3fe5c53b2b0..9366eb413d9 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdatastore.h +++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.h @@ -189,8 +189,8 @@ private: void compactWorst(uint64_t syncToken, bool compactDiskBloat); void compactFile(FileId chunkId); - typedef vespalib::RcuVector<uint64_t> LidInfoVector; - typedef std::vector<FileChunk::UP> FileChunkVector; + using LidInfoVector = vespalib::RcuVector<uint64_t>; + using FileChunkVector = std::vector<FileChunk::UP>; void updateLidMap(uint32_t lastFileChunkDocIdLimit); void preload(); @@ -251,7 +251,7 @@ private: void incGeneration(); bool canShrinkLidSpace(const MonitorGuard &guard) const; - typedef std::vector<FileId> FileIdxVector; + using FileIdxVector = std::vector<FileId>; Config _config; TuneFileSummary _tune; const search::common::FileHeaderContext &_fileHeaderContext; diff --git a/searchlib/src/vespa/searchlib/docstore/randread.h b/searchlib/src/vespa/searchlib/docstore/randread.h index 1c1130049de..63e615e2b23 100644 --- a/searchlib/src/vespa/searchlib/docstore/randread.h +++ b/searchlib/src/vespa/searchlib/docstore/randread.h @@ -15,7 +15,7 @@ namespace search { class FileRandRead { public: - typedef std::shared_ptr<FastOS_FileInterface> FSP; + using FSP = std::shared_ptr<FastOS_FileInterface>; virtual ~FileRandRead() { } virtual FSP read(size_t offset, vespalib::DataBuffer & buffer, size_t sz) = 0; virtual int64_t getSize() = 0; diff --git a/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp b/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp index 1edfa6304b1..4248f42a5b4 100644 --- a/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp +++ b/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp @@ -811,7 +811,7 @@ WriteableFileChunk::readIdxHeader(FastOS_FileInterface & idxFile) void WriteableFileChunk::writeDataHeader(const FileHeaderContext &fileHeaderContext) { - typedef FileHeader::Tag Tag; + using Tag = FileHeader::Tag; FileHeader h(FileSettings::DIRECTIO_ALIGNMENT); assert(_dataFile.IsOpened()); assert(_dataFile.IsWriteMode()); @@ -825,7 +825,7 @@ WriteableFileChunk::writeDataHeader(const FileHeaderContext &fileHeaderContext) uint64_t WriteableFileChunk::writeIdxHeader(const FileHeaderContext &fileHeaderContext, uint32_t docIdLimit, FastOS_FileInterface &file) { - typedef FileHeader::Tag Tag; + using Tag = FileHeader::Tag; FileHeader h; assert(file.IsOpened()); assert(file.IsWriteMode()); diff --git a/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.h b/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.h index 0cefe179304..4a34b9c9e05 100644 --- a/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.h +++ b/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.h @@ -42,7 +42,7 @@ public: }; public: - typedef std::unique_ptr<WriteableFileChunk> UP; + using UP = std::unique_ptr<WriteableFileChunk>; WriteableFileChunk(vespalib::Executor & executor, FileId fileId, NameId nameId, const vespalib::string & baseName, uint64_t initialSerialNum, uint32_t docIdLimit, const Config & config, @@ -73,9 +73,9 @@ public: static uint64_t writeIdxHeader(const common::FileHeaderContext &fileHeaderContext, uint32_t docIdLimit, FastOS_FileInterface &file); private: using ProcessedChunkUP = std::unique_ptr<ProcessedChunk>; - typedef std::map<uint32_t, ProcessedChunkUP > ProcessedChunkMap; + using ProcessedChunkMap = std::map<uint32_t, ProcessedChunkUP >; - typedef std::vector<ProcessedChunkUP> ProcessedChunkQ; + using ProcessedChunkQ = std::vector<ProcessedChunkUP>; bool frozen() const override { return _frozen.load(std::memory_order_acquire); } void waitForChunkFlushedToDisk(uint32_t chunkId) const; diff --git a/searchlib/src/vespa/searchlib/engine/propertiesmap.h b/searchlib/src/vespa/searchlib/engine/propertiesmap.h index 3d50789887b..5ba48553b90 100644 --- a/searchlib/src/vespa/searchlib/engine/propertiesmap.h +++ b/searchlib/src/vespa/searchlib/engine/propertiesmap.h @@ -31,7 +31,7 @@ private: const Props &lookup(vespalib::stringref name) const; public: - typedef PropsMap::const_iterator ITR; + using ITR = PropsMap::const_iterator; PropertiesMap(); PropertiesMap(uint32_t sz); diff --git a/searchlib/src/vespa/searchlib/expression/arrayoperationnode.h b/searchlib/src/vespa/searchlib/expression/arrayoperationnode.h index b114a7ff115..cc2eac6fc17 100644 --- a/searchlib/src/vespa/searchlib/expression/arrayoperationnode.h +++ b/searchlib/src/vespa/searchlib/expression/arrayoperationnode.h @@ -11,8 +11,8 @@ namespace expression { class ArrayOperationNode : public FunctionNode { public: - typedef attribute::IAttributeVector IAttributeVector; - typedef attribute::IAttributeContext IAttributeContext; + using IAttributeVector = attribute::IAttributeVector; + using IAttributeContext = attribute::IAttributeContext; DECLARE_NBO_SERIALIZE; DECLARE_ABSTRACT_EXPRESSIONNODE(ArrayOperationNode); diff --git a/searchlib/src/vespa/searchlib/expression/attributenode.h b/searchlib/src/vespa/searchlib/expression/attributenode.h index 3fb327c5b7b..03b7909e581 100644 --- a/searchlib/src/vespa/searchlib/expression/attributenode.h +++ b/searchlib/src/vespa/searchlib/expression/attributenode.h @@ -13,8 +13,8 @@ namespace search::expression { class AttributeNode : public FunctionNode { - typedef vespalib::BufferRef BufferRef; - typedef vespalib::ConstBufferRef ConstBufferRef; + using BufferRef = vespalib::BufferRef; + using ConstBufferRef = vespalib::ConstBufferRef; public: DECLARE_NBO_SERIALIZE; class Configure : public vespalib::ObjectOperation, public vespalib::ObjectPredicate diff --git a/searchlib/src/vespa/searchlib/expression/attributeresult.h b/searchlib/src/vespa/searchlib/expression/attributeresult.h index a4ff376526d..0501b6477cf 100644 --- a/searchlib/src/vespa/searchlib/expression/attributeresult.h +++ b/searchlib/src/vespa/searchlib/expression/attributeresult.h @@ -10,7 +10,7 @@ namespace search::expression { class AttributeResult : public ResultNode { public: - typedef std::unique_ptr<AttributeResult> UP; + using UP = std::unique_ptr<AttributeResult>; DECLARE_RESULTNODE(AttributeResult); AttributeResult() : _attribute(nullptr), _docId(0) { } AttributeResult(const attribute::IAttributeVector * attribute, DocId docId) : diff --git a/searchlib/src/vespa/searchlib/expression/enumresultnode.h b/searchlib/src/vespa/searchlib/expression/enumresultnode.h index 8aff46b3a16..14dacd75651 100644 --- a/searchlib/src/vespa/searchlib/expression/enumresultnode.h +++ b/searchlib/src/vespa/searchlib/expression/enumresultnode.h @@ -9,7 +9,7 @@ namespace expression { class EnumResultNode : public IntegerResultNodeT<int64_t> { private: - typedef IntegerResultNodeT<int64_t> Base; + using Base = IntegerResultNodeT<int64_t>; public: DECLARE_RESULTNODE(EnumResultNode); EnumResultNode(int64_t v=0) : Base(v) { } diff --git a/searchlib/src/vespa/searchlib/expression/expressionnode.h b/searchlib/src/vespa/searchlib/expression/expressionnode.h index 9c2c4c5d3e0..9f451e4713e 100644 --- a/searchlib/src/vespa/searchlib/expression/expressionnode.h +++ b/searchlib/src/vespa/searchlib/expression/expressionnode.h @@ -9,7 +9,7 @@ namespace search::attribute { class IAttributeContext; } namespace search::expression { -typedef uint32_t DocId; +using DocId = uint32_t; class ResultNode; @@ -50,6 +50,6 @@ private: virtual bool onExecute() const = 0; }; -typedef ExpressionNode::CP * ExpressionNodeArray; +using ExpressionNodeArray = ExpressionNode::CP *; } diff --git a/searchlib/src/vespa/searchlib/expression/expressiontree.h b/searchlib/src/vespa/searchlib/expression/expressiontree.h index 9497772059e..b9517fc5f69 100644 --- a/searchlib/src/vespa/searchlib/expression/expressiontree.h +++ b/searchlib/src/vespa/searchlib/expression/expressiontree.h @@ -64,11 +64,11 @@ private: bool onExecute() const override { return _root->execute(); } void onPrepare(bool preserveAccurateTypes) override; - typedef std::vector<AttributeNode *> AttributeNodeList; - typedef std::vector<DocumentAccessorNode *> DocumentAccessorNodeList; - typedef std::vector<RelevanceNode *> RelevanceNodeList; - typedef std::vector<InterpolatedLookup *> InterpolatedLookupList; - typedef std::vector<ArrayAtLookup *> ArrayAtLookupList; + using AttributeNodeList = std::vector<AttributeNode *>; + using DocumentAccessorNodeList = std::vector<DocumentAccessorNode *>; + using RelevanceNodeList = std::vector<RelevanceNode *>; + using InterpolatedLookupList = std::vector<InterpolatedLookup *>; + using ArrayAtLookupList = std::vector<ArrayAtLookup *>; ExpressionNode::CP _root; AttributeNodeList _attributeNodes; diff --git a/searchlib/src/vespa/searchlib/expression/fixedwidthbucketfunctionnode.h b/searchlib/src/vespa/searchlib/expression/fixedwidthbucketfunctionnode.h index 80c5281c9a2..000bdf733c5 100644 --- a/searchlib/src/vespa/searchlib/expression/fixedwidthbucketfunctionnode.h +++ b/searchlib/src/vespa/searchlib/expression/fixedwidthbucketfunctionnode.h @@ -16,7 +16,7 @@ class FixedWidthBucketFunctionNode : public UnaryFunctionNode public: // update result bucket based on numeric value struct BucketHandler { - typedef vespalib::CloneablePtr<BucketHandler> CP; + using CP = vespalib::CloneablePtr<BucketHandler>; virtual void update(ResultNode &result, const ResultNode &value) const = 0; virtual BucketHandler *clone() const = 0; virtual ~BucketHandler() {} diff --git a/searchlib/src/vespa/searchlib/expression/integerresultnode.h b/searchlib/src/vespa/searchlib/expression/integerresultnode.h index e63ac783bc8..b823b7632d9 100644 --- a/searchlib/src/vespa/searchlib/expression/integerresultnode.h +++ b/searchlib/src/vespa/searchlib/expression/integerresultnode.h @@ -109,7 +109,7 @@ private: class Int8ResultNode : public IntegerResultNodeT<int8_t> { private: - typedef IntegerResultNodeT<int8_t> Base; + using Base = IntegerResultNodeT<int8_t>; public: DECLARE_RESULTNODE(Int8ResultNode); Int8ResultNode(int8_t v=0) : Base(v) { } @@ -120,7 +120,7 @@ private: class Int16ResultNode : public IntegerResultNodeT<int16_t> { private: - typedef IntegerResultNodeT<int16_t> Base; + using Base = IntegerResultNodeT<int16_t>; public: DECLARE_RESULTNODE(Int16ResultNode); Int16ResultNode(int16_t v=0) : Base(v) { } @@ -131,7 +131,7 @@ private: class Int32ResultNode : public IntegerResultNodeT<int32_t> { private: - typedef IntegerResultNodeT<int32_t> Base; + using Base = IntegerResultNodeT<int32_t>; public: DECLARE_RESULTNODE(Int32ResultNode); Int32ResultNode(int32_t v=0) : Base(v) { } @@ -142,7 +142,7 @@ private: class Int64ResultNode : public IntegerResultNodeT<int64_t> { private: - typedef IntegerResultNodeT<int64_t> Base; + using Base = IntegerResultNodeT<int64_t>; public: DECLARE_RESULTNODE(Int64ResultNode); Int64ResultNode(int64_t v=0) : Base(v) { } diff --git a/searchlib/src/vespa/searchlib/expression/multiargfunctionnode.h b/searchlib/src/vespa/searchlib/expression/multiargfunctionnode.h index 67debb5c6ba..6702fa37215 100644 --- a/searchlib/src/vespa/searchlib/expression/multiargfunctionnode.h +++ b/searchlib/src/vespa/searchlib/expression/multiargfunctionnode.h @@ -9,7 +9,7 @@ namespace expression { class MultiArgFunctionNode : public FunctionNode { public: - typedef std::vector<ExpressionNode::CP> ExpressionNodeVector; + using ExpressionNodeVector = std::vector<ExpressionNode::CP>; DECLARE_NBO_SERIALIZE; void visitMembers(vespalib::ObjectVisitor & visitor) const override; DECLARE_ABSTRACT_EXPRESSIONNODE(MultiArgFunctionNode); diff --git a/searchlib/src/vespa/searchlib/expression/numericfunctionnode.h b/searchlib/src/vespa/searchlib/expression/numericfunctionnode.h index 1c4b68b3a84..e64525a8cc0 100644 --- a/searchlib/src/vespa/searchlib/expression/numericfunctionnode.h +++ b/searchlib/src/vespa/searchlib/expression/numericfunctionnode.h @@ -48,21 +48,21 @@ protected: class VectorIntegerHandler : public VectorHandler<IntegerResultNodeVector> { private: - typedef VectorHandler<IntegerResultNodeVector> BaseHandler; + using BaseHandler = VectorHandler<IntegerResultNodeVector>; public: VectorIntegerHandler(const NumericFunctionNode & func) : BaseHandler(func) { } }; class VectorFloatHandler : public VectorHandler<FloatResultNodeVector> { private: - typedef VectorHandler<FloatResultNodeVector> BaseHandler; + using BaseHandler = VectorHandler<FloatResultNodeVector>; public: VectorFloatHandler(const NumericFunctionNode & func) : BaseHandler(func) { } }; class VectorStringHandler : public VectorHandler<StringResultNodeVector> { private: - typedef VectorHandler<StringResultNodeVector> BaseHandler; + using BaseHandler = VectorHandler<StringResultNodeVector>; public: VectorStringHandler(const NumericFunctionNode & func) : BaseHandler(func) { } }; diff --git a/searchlib/src/vespa/searchlib/expression/numericresultnode.h b/searchlib/src/vespa/searchlib/expression/numericresultnode.h index 440b549a1a2..7831f238546 100644 --- a/searchlib/src/vespa/searchlib/expression/numericresultnode.h +++ b/searchlib/src/vespa/searchlib/expression/numericresultnode.h @@ -9,8 +9,8 @@ class NumericResultNode : public SingleResultNode { public: DECLARE_ABSTRACT_EXPRESSIONNODE(NumericResultNode); - typedef vespalib::IdentifiablePtr<NumericResultNode> CP; - typedef std::unique_ptr<NumericResultNode> UP; + using CP = vespalib::IdentifiablePtr<NumericResultNode>; + using UP = std::unique_ptr<NumericResultNode>; virtual NumericResultNode *clone() const override = 0; virtual void multiply(const ResultNode & b) = 0; virtual void divide(const ResultNode & b) = 0; diff --git a/searchlib/src/vespa/searchlib/expression/rawresultnode.h b/searchlib/src/vespa/searchlib/expression/rawresultnode.h index e6712144831..707ffcc027d 100644 --- a/searchlib/src/vespa/searchlib/expression/rawresultnode.h +++ b/searchlib/src/vespa/searchlib/expression/rawresultnode.h @@ -25,7 +25,7 @@ public: void negate() override; const BucketResultNode& getNullBucket() const override; private: - typedef std::vector<uint8_t> V; + using V = std::vector<uint8_t>; int cmpMem(const void * a, const void *b) const override { const V & ai(*static_cast<const V *>(a)); const V & bi(*static_cast<const V *>(b)); diff --git a/searchlib/src/vespa/searchlib/expression/resultnode.h b/searchlib/src/vespa/searchlib/expression/resultnode.h index cb1c709a09d..4c81259325b 100644 --- a/searchlib/src/vespa/searchlib/expression/resultnode.h +++ b/searchlib/src/vespa/searchlib/expression/resultnode.h @@ -33,8 +33,8 @@ class BucketResultNode; class ResultNode : public vespalib::Identifiable { public: - typedef vespalib::BufferRef BufferRef; - typedef vespalib::ConstBufferRef ConstBufferRef; + using BufferRef = vespalib::BufferRef; + using ConstBufferRef = vespalib::ConstBufferRef; public: int64_t getInteger() const { return onGetInteger(0); } int64_t getEnum() const { return onGetEnum(0); } @@ -54,8 +54,8 @@ private: public: DECLARE_ABSTRACT_RESULTNODE(ResultNode); ~ResultNode() { } - typedef std::unique_ptr<ResultNode> UP; - typedef vespalib::IdentifiablePtr<ResultNode> CP; + using UP = std::unique_ptr<ResultNode>; + using CP = vespalib::IdentifiablePtr<ResultNode>; virtual void set(const ResultNode & rhs) = 0; /** diff --git a/searchlib/src/vespa/searchlib/expression/resultvector.h b/searchlib/src/vespa/searchlib/expression/resultvector.h index 81d73e9b1f5..fa0e2d9a71f 100644 --- a/searchlib/src/vespa/searchlib/expression/resultvector.h +++ b/searchlib/src/vespa/searchlib/expression/resultvector.h @@ -21,8 +21,8 @@ class ResultNodeVector : public ResultNode public: DECLARE_ABSTRACT_EXPRESSIONNODE(ResultNodeVector); DECLARE_RESULTNODE_SERIALIZE; - typedef std::unique_ptr<ResultNodeVector> UP; - typedef vespalib::IdentifiablePtr<ResultNodeVector> CP; + using UP = std::unique_ptr<ResultNodeVector>; + using CP = vespalib::IdentifiablePtr<ResultNodeVector>; virtual const ResultNode * find(const ResultNode & key) const = 0; virtual ResultNodeVector & push_back(const ResultNode & node) = 0; virtual ResultNodeVector & push_back_safe(const ResultNode & node) = 0; @@ -153,7 +153,7 @@ int ResultNodeVectorT<B, C, G>::onCmp(const Identifiable & rhs) const template <typename B, typename C, typename G> void ResultNodeVectorT<B, C, G>::sort() { - typedef cmpT<B> LC; + using LC = cmpT<B>; std::sort(_result.begin(), _result.end(), typename LC::less()); } @@ -353,7 +353,7 @@ public: const IntegerBucketResultNode& getNullBucket() const override { return IntegerBucketResultNode::getNull(); } }; -typedef Int64ResultNodeVector IntegerResultNodeVector; +using IntegerResultNodeVector = Int64ResultNodeVector; class EnumResultNodeVector : public NumericResultNodeVectorT<EnumResultNode> { diff --git a/searchlib/src/vespa/searchlib/expression/singleresultnode.h b/searchlib/src/vespa/searchlib/expression/singleresultnode.h index 5ae183d6cc1..e11c866c2f5 100644 --- a/searchlib/src/vespa/searchlib/expression/singleresultnode.h +++ b/searchlib/src/vespa/searchlib/expression/singleresultnode.h @@ -10,8 +10,8 @@ class SingleResultNode : public ResultNode public: virtual ~SingleResultNode() { } DECLARE_ABSTRACT_RESULTNODE(SingleResultNode); - typedef vespalib::IdentifiablePtr<SingleResultNode> CP; - typedef std::unique_ptr<SingleResultNode> UP; + using CP = vespalib::IdentifiablePtr<SingleResultNode>; + using UP = std::unique_ptr<SingleResultNode>; virtual SingleResultNode *clone() const override = 0; virtual void min(const ResultNode & b) = 0; diff --git a/searchlib/src/vespa/searchlib/features/agefeature.cpp b/searchlib/src/vespa/searchlib/features/agefeature.cpp index c4067c736c5..d0ba622219f 100644 --- a/searchlib/src/vespa/searchlib/features/agefeature.cpp +++ b/searchlib/src/vespa/searchlib/features/agefeature.cpp @@ -10,7 +10,7 @@ using search::attribute::IAttributeVector; namespace search { -typedef fef::FeatureNameBuilder FNB; +using FNB = fef::FeatureNameBuilder; namespace features { diff --git a/searchlib/src/vespa/searchlib/features/array_parser.h b/searchlib/src/vespa/searchlib/features/array_parser.h index d662bb07309..6433d87a843 100644 --- a/searchlib/src/vespa/searchlib/features/array_parser.h +++ b/searchlib/src/vespa/searchlib/features/array_parser.h @@ -25,7 +25,7 @@ public: template <typename T> class ValueAndIndex { public: - typedef T ValueType; + using ValueType = T; ValueAndIndex(T value, uint32_t index) noexcept : _value(value), _index(index) { } T getValue() const { return _value; } uint32_t getIndex() const { return _index; } diff --git a/searchlib/src/vespa/searchlib/features/array_parser.hpp b/searchlib/src/vespa/searchlib/features/array_parser.hpp index 397b4c6588c..fdd6a86fefd 100644 --- a/searchlib/src/vespa/searchlib/features/array_parser.hpp +++ b/searchlib/src/vespa/searchlib/features/array_parser.hpp @@ -17,7 +17,7 @@ template <typename OutputType, typename T> void ArrayParser::parse(const vespalib::string &input, OutputType &output) { - typedef std::vector<ValueAndIndex<T>> SparseVector; + using SparseVector = std::vector<ValueAndIndex<T>>; SparseVector sparse; parsePartial(input, sparse); std::sort(sparse.begin(), sparse.end()); @@ -36,7 +36,7 @@ ArrayParser::parsePartial(const vespalib::string &input, OutputType &output) size_t len = input.size(); if (len >= 2) { vespalib::stringref s(input.c_str()+1, len - 2); - typedef typename OutputType::value_type ValueAndIndexType; + using ValueAndIndexType = typename OutputType::value_type; typename ValueAndIndexType::ValueType value; if ((input[0] == '{' && input[len - 1] == '}') || (input[0] == '(' && input[len - 1] == ')') ) { diff --git a/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp b/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp index a86a91fb4a8..54a7c225dcd 100644 --- a/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/attributematchfeature.cpp @@ -30,7 +30,7 @@ feature_t adjustToOne(feature_t value) { bool hasAttribute(const IQueryEnvironment &env, const ITermData &term_data) { - typedef ITermFieldRangeAdapter FRA; + using FRA = ITermFieldRangeAdapter; for (FRA iter(term_data); iter.valid(); iter.next()) { const FieldInfo *info = env.getIndexEnvironment().getField(iter.get().getFieldId()); diff --git a/searchlib/src/vespa/searchlib/features/documenttestutils.cpp b/searchlib/src/vespa/searchlib/features/documenttestutils.cpp index 667fef987b9..ad64af1aa09 100644 --- a/searchlib/src/vespa/searchlib/features/documenttestutils.cpp +++ b/searchlib/src/vespa/searchlib/features/documenttestutils.cpp @@ -110,7 +110,7 @@ getSignificance(double docFreq) feature_t getSignificance(const search::fef::ITermData& termData) { - typedef search::fef::ITermFieldRangeAdapter FRA; + using FRA = search::fef::ITermFieldRangeAdapter; double df = 0; for (FRA iter(termData); iter.valid(); iter.next()) { df = std::max(df, iter.get().getDocFreq()); diff --git a/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp b/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp index b5a8c9bcb43..47b5e0161e9 100644 --- a/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp @@ -298,7 +298,7 @@ template <typename T, typename AsT = T> void parseVectors(const Property& prop, std::vector<T>& values, std::vector<uint32_t>& indexes) { - typedef std::vector<ArrayParser::ValueAndIndex<AsT>> SparseV; + using SparseV = std::vector<ArrayParser::ValueAndIndex<AsT>>; SparseV sparse; ArrayParser::parsePartial(prop.get(), sparse); if ( ! sparse.empty()) { diff --git a/searchlib/src/vespa/searchlib/features/dotproductfeature.h b/searchlib/src/vespa/searchlib/features/dotproductfeature.h index 1339dbf985e..229f57b7526 100644 --- a/searchlib/src/vespa/searchlib/features/dotproductfeature.h +++ b/searchlib/src/vespa/searchlib/features/dotproductfeature.h @@ -48,9 +48,9 @@ namespace wset { template <typename DimensionVType, typename DimensionHType, typename ComponentType, typename HashMapComparator = std::equal_to<DimensionHType> > class VectorBase : public fef::Anything { public: - typedef std::pair<DimensionVType, ComponentType> Element; // <dimension, component> - typedef std::vector<Element> Vector; - typedef vespalib::hash_map<DimensionHType, ComponentType, vespalib::hash<DimensionHType>, HashMapComparator, vespalib::hashtable_base::and_modulator> HashMap; + using Element = std::pair<DimensionVType, ComponentType>; // <dimension, component> + using Vector = std::vector<Element>; + using HashMap = vespalib::hash_map<DimensionHType, ComponentType, vespalib::hash<DimensionHType>, HashMapComparator, vespalib::hashtable_base::and_modulator>; protected: VectorBase(); Vector _vector; @@ -211,8 +211,8 @@ public: template <typename BaseType> class SparseDotProductExecutorBase : public DotProductExecutorBase<BaseType> { public: - typedef std::vector<uint32_t> IV; - typedef typename DotProductExecutorBase<BaseType>::V V; + using IV = std::vector<uint32_t>; + using V = typename DotProductExecutorBase<BaseType>::V; SparseDotProductExecutorBase(const V & queryVector, const IV & queryIndexes); ~SparseDotProductExecutorBase(); protected: @@ -225,8 +225,8 @@ class SparseDotProductByArrayReadViewExecutor : public SparseDotProductExecutorB public: using SparseDotProductExecutorBase<BaseType>::_queryIndexes; using SparseDotProductExecutorBase<BaseType>::_scratch; - typedef std::vector<uint32_t> IV; - typedef typename SparseDotProductExecutorBase<BaseType>::V V; + using IV = std::vector<uint32_t>; + using V = typename SparseDotProductExecutorBase<BaseType>::V; using ArrayReadView = attribute::IArrayReadView<BaseType>; SparseDotProductByArrayReadViewExecutor(const ArrayReadView* array_read_view, const V & queryVector, const IV & queryIndexes); ~SparseDotProductByArrayReadViewExecutor(); diff --git a/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp b/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp index 3edfecd9a2c..6128850bd1f 100644 --- a/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/element_completeness_feature.cpp @@ -23,7 +23,7 @@ ElementCompletenessExecutor::ElementCompletenessExecutor(const fef::IQueryEnviro for (uint32_t i = 0; i < env.getNumTerms(); ++i) { const fef::ITermData *termData = env.getTerm(i); if (termData->getWeight().percent() != 0) { // only consider query terms with contribution - typedef fef::ITermFieldRangeAdapter FRA; + using FRA = fef::ITermFieldRangeAdapter; for (FRA iter(*termData); iter.valid(); iter.next()) { const fef::ITermFieldData &tfd = iter.get(); if (tfd.getFieldId() == _params.fieldId) { diff --git a/searchlib/src/vespa/searchlib/features/element_similarity_feature.cpp b/searchlib/src/vespa/searchlib/features/element_similarity_feature.cpp index 2b30442f35c..a58f97a2755 100644 --- a/searchlib/src/vespa/searchlib/features/element_similarity_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/element_similarity_feature.cpp @@ -20,7 +20,7 @@ namespace { //----------------------------------------------------------------------------- struct Aggregator { - typedef std::unique_ptr<Aggregator> UP; + using UP = std::unique_ptr<Aggregator>; virtual UP create() const = 0; virtual void clear() = 0; virtual void add(double) = 0; @@ -79,7 +79,7 @@ create_aggregator(const vespalib::string &name) { typedef double (*function_5)(double, double, double, double, double); -typedef std::pair<function_5, Aggregator::UP> OutputSpec; +using OutputSpec = std::pair<function_5, Aggregator::UP>; //----------------------------------------------------------------------------- @@ -111,7 +111,7 @@ struct VectorizedQueryTerms { for (uint32_t i = 0; i < env.getNumTerms(); ++i) { const fef::ITermData *termData = env.getTerm(i); if (termData->getWeight().percent() != 0) { // only consider query terms with contribution - typedef fef::ITermFieldRangeAdapter FRA; + using FRA = fef::ITermFieldRangeAdapter; for (FRA iter(*termData); iter.valid(); iter.next()) { const fef::ITermFieldData &tfd = iter.get(); if (tfd.getFieldId() == field_id) { @@ -200,7 +200,7 @@ struct State { class ElementSimilarityExecutor : public fef::FeatureExecutor { private: - typedef fef::TermFieldMatchData::PositionsIterator ITR; + using ITR = fef::TermFieldMatchData::PositionsIterator; struct CmpPosition { ITR *pos; @@ -224,8 +224,8 @@ private: } }; - typedef vespalib::PriorityQueue<uint16_t, CmpPosition> PositionQueue; - typedef vespalib::PriorityQueue<uint16_t, CmpElement> ElementQueue; + using PositionQueue = vespalib::PriorityQueue<uint16_t, CmpPosition>; + using ElementQueue = vespalib::PriorityQueue<uint16_t, CmpElement>; VectorizedQueryTerms _terms; std::vector<ITR> _pos; diff --git a/searchlib/src/vespa/searchlib/features/element_similarity_feature.h b/searchlib/src/vespa/searchlib/features/element_similarity_feature.h index 11be77aa77a..8997e55b584 100644 --- a/searchlib/src/vespa/searchlib/features/element_similarity_feature.h +++ b/searchlib/src/vespa/searchlib/features/element_similarity_feature.h @@ -13,7 +13,7 @@ class ElementSimilarityBlueprint : public fef::Blueprint { private: struct OutputContext; - typedef std::unique_ptr<OutputContext> OutputContext_UP; + using OutputContext_UP = std::unique_ptr<OutputContext>; uint32_t _field_id; std::vector<OutputContext_UP> _outputs; diff --git a/searchlib/src/vespa/searchlib/features/euclidean_distance_feature.h b/searchlib/src/vespa/searchlib/features/euclidean_distance_feature.h index 76b47bb0d64..30d6a3b1987 100644 --- a/searchlib/src/vespa/searchlib/features/euclidean_distance_feature.h +++ b/searchlib/src/vespa/searchlib/features/euclidean_distance_feature.h @@ -14,8 +14,8 @@ template <typename DataType> class EuclideanDistanceExecutor : public fef::FeatureExecutor { public: - typedef search::attribute::AttributeContent<DataType> BufferType; - typedef std::vector<DataType> QueryVectorType; + using BufferType = search::attribute::AttributeContent<DataType>; + using QueryVectorType = std::vector<DataType>; private: const search::attribute::IAttributeVector &_attribute; diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h b/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h index a0e1200876f..72154784ac2 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h +++ b/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h @@ -284,8 +284,8 @@ private: private: - typedef std::shared_ptr<BitVector> BitVectorPtr; - typedef std::vector<const fef::TermFieldMatchData *> TermFieldMatchDataVector; + using BitVectorPtr = std::shared_ptr<BitVector>; + using TermFieldMatchDataVector = std::vector<const fef::TermFieldMatchData *>; struct SegmentData { SegmentData() : segment(), valid(false) {} diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.h b/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.h index 5d1738a47ba..4e16df89c39 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.h +++ b/searchlib/src/vespa/searchlib/features/fieldmatch/metrics.h @@ -21,8 +21,8 @@ public: /** * Convenience typedefs. */ - typedef std::unique_ptr<Metrics> UP; - typedef std::shared_ptr<Metrics> SP; + using UP = std::unique_ptr<Metrics>; + using SP = std::shared_ptr<Metrics>; public: /** diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.h b/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.h index 90b05971b8f..88acbb5039b 100644 --- a/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.h +++ b/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.h @@ -23,8 +23,8 @@ public: /** * Convenience typedefs. */ - typedef std::unique_ptr<SegmentStart> UP; - typedef std::shared_ptr<SegmentStart> SP; + using UP = std::unique_ptr<SegmentStart>; + using SP = std::shared_ptr<SegmentStart>; public: /** diff --git a/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp b/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp index 581ab1584a1..5f9c5543f57 100644 --- a/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/flow_completeness_feature.cpp @@ -30,7 +30,7 @@ FlowCompletenessExecutor::FlowCompletenessExecutor(const fef::IQueryEnvironment const fef::ITermData *termData = env.getTerm(i); LOG(spam, "term %u weight %u", i, termData->getWeight().percent()); if (termData->getWeight().percent() != 0) { // only consider query terms with contribution - typedef fef::ITermFieldRangeAdapter FRA; + using FRA = fef::ITermFieldRangeAdapter; uint32_t j = 0; for (FRA iter(*termData); iter.valid(); iter.next()) { const fef::ITermFieldData &tfd = iter.get(); @@ -48,10 +48,10 @@ FlowCompletenessExecutor::FlowCompletenessExecutor(const fef::IQueryEnvironment } namespace { -typedef std::vector<uint32_t> TermIdxList; -typedef std::vector<uint32_t> PosList; +using TermIdxList = std::vector<uint32_t>; +using PosList = std::vector<uint32_t>; -typedef vespalib::hash_map<uint32_t, uint32_t> TermIdxMap; +using TermIdxMap = vespalib::hash_map<uint32_t, uint32_t>; struct State { int elementWeight; diff --git a/searchlib/src/vespa/searchlib/features/item_raw_score_feature.h b/searchlib/src/vespa/searchlib/features/item_raw_score_feature.h index 3f93ca5ad75..b488ff362e5 100644 --- a/searchlib/src/vespa/searchlib/features/item_raw_score_feature.h +++ b/searchlib/src/vespa/searchlib/features/item_raw_score_feature.h @@ -9,7 +9,7 @@ namespace search::features { class ItemRawScoreExecutor : public fef::FeatureExecutor { public: - typedef std::vector<fef::TermFieldHandle> HandleVector; + using HandleVector = std::vector<fef::TermFieldHandle>; private: HandleVector _handles; const fef::MatchData *_md; @@ -42,7 +42,7 @@ public: class ItemRawScoreBlueprint : public fef::Blueprint { private: - typedef std::vector<fef::TermFieldHandle> HandleVector; + using HandleVector = std::vector<fef::TermFieldHandle>; vespalib::string _label; public: ItemRawScoreBlueprint() : Blueprint("itemRawScore"), _label() {} diff --git a/searchlib/src/vespa/searchlib/features/native_dot_product_feature.h b/searchlib/src/vespa/searchlib/features/native_dot_product_feature.h index c546ed86501..921bde3c708 100644 --- a/searchlib/src/vespa/searchlib/features/native_dot_product_feature.h +++ b/searchlib/src/vespa/searchlib/features/native_dot_product_feature.h @@ -11,7 +11,7 @@ namespace search::features { class NativeDotProductExecutor : public fef::FeatureExecutor { private: - typedef std::pair<fef::TermFieldHandle,query::Weight> Pair; + using Pair = std::pair<fef::TermFieldHandle,query::Weight>; std::vector<Pair> _pairs; const fef::MatchData *_md; diff --git a/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp b/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp index be8b35da43d..2a25806c116 100644 --- a/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.cpp @@ -28,7 +28,7 @@ NativeAttributeMatchExecutor::preComputeSetup(const IQueryEnvironment & env, const ITermData *termData = env.getTerm(i); if (termData->getWeight().percent() != 0) // only consider query terms with contribution { - typedef search::fef::ITermFieldRangeAdapter FRA; + using FRA = search::fef::ITermFieldRangeAdapter; for (FRA iter(*termData); iter.valid(); iter.next()) { const ITermFieldData& tfd = iter.get(); uint32_t fieldId = tfd.getFieldId(); diff --git a/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.h b/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.h index 06ff68bcd88..2584ce0f3f9 100644 --- a/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.h +++ b/searchlib/src/vespa/searchlib/features/nativeattributematchfeature.h @@ -17,7 +17,7 @@ struct NativeAttributeMatchParam : public NativeParamBase NativeAttributeMatchParam() : NativeParamBase() { } fef::SymmetricTable weightBoostTable; }; -typedef NativeRankParamsBase<NativeAttributeMatchParam> NativeAttributeMatchParams; +using NativeAttributeMatchParams = NativeRankParamsBase<NativeAttributeMatchParam>; /** * Implements the executor for calculating the native attribute match score. @@ -35,8 +35,8 @@ protected: const fef::SymmetricTable * weightBoostTable; fef::TermFieldHandle tfh; }; - typedef std::vector<CachedTermData> CachedVector; - typedef std::pair<CachedVector, feature_t> Precomputed; + using CachedVector = std::vector<CachedTermData>; + using Precomputed = std::pair<CachedVector, feature_t>; static feature_t calculateScore(const CachedTermData &td, const fef::TermFieldMatchData &tfmd); private: diff --git a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp index 0917a379acf..499fa2bdc00 100644 --- a/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/nativefieldmatchfeature.cpp @@ -28,7 +28,7 @@ NativeFieldMatchExecutorSharedState::NativeFieldMatchExecutorSharedState(const I if (qtTmp.termData()->getWeight().percent() != 0) // only consider query terms with contribution { MyQueryTerm qt(qtTmp); - typedef search::fef::ITermFieldRangeAdapter FRA; + using FRA = search::fef::ITermFieldRangeAdapter; uint32_t totalFieldWeight = 0; for (FRA iter(*qt.termData()); iter.valid(); iter.next()) { const ITermFieldData& tfd = iter.get(); diff --git a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp index 5f4a34f9627..6f49d92d042 100644 --- a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.cpp @@ -24,7 +24,7 @@ NativeProximityExecutorSharedState::NativeProximityExecutorSharedState(const IQu { QueryTermHelper queryTerms(env); for (const QueryTerm& qt : queryTerms.terms()) { - typedef search::fef::ITermFieldRangeAdapter FRA; + using FRA = search::fef::ITermFieldRangeAdapter; for (FRA iter(*qt.termData()); iter.valid(); iter.next()) { uint32_t fieldId = iter.get().getFieldId(); if (_params.considerField(fieldId)) { // only consider fields with contribution diff --git a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h index e40779dae14..c5a485cecac 100644 --- a/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h +++ b/searchlib/src/vespa/searchlib/features/nativeproximityfeature.h @@ -42,7 +42,7 @@ public: TermPair(QueryTerm f, QueryTerm s, feature_t c) : first(f), second(s), connectedness(c) {} }; - typedef std::vector<TermPair> TermPairVector; + using TermPairVector = std::vector<TermPair>; /** * Represents the setup needed to calculate the proximity score for a single field. **/ diff --git a/searchlib/src/vespa/searchlib/features/nativerankfeature.h b/searchlib/src/vespa/searchlib/features/nativerankfeature.h index 8e31917101d..3a1234ac4ca 100644 --- a/searchlib/src/vespa/searchlib/features/nativerankfeature.h +++ b/searchlib/src/vespa/searchlib/features/nativerankfeature.h @@ -31,7 +31,7 @@ struct NativeParamBase { template <class P> class NativeRankParamsBase { public: - typedef P Param; + using Param = P; std::vector<P> vector; NativeRankParamsBase() : vector() {} void resize(size_t numFields) { diff --git a/searchlib/src/vespa/searchlib/features/term_field_md_feature.h b/searchlib/src/vespa/searchlib/features/term_field_md_feature.h index bd8e911f97f..5d0ea8822ef 100644 --- a/searchlib/src/vespa/searchlib/features/term_field_md_feature.h +++ b/searchlib/src/vespa/searchlib/features/term_field_md_feature.h @@ -14,7 +14,7 @@ namespace search::features { **/ class TermFieldMdExecutor : public fef::FeatureExecutor { - typedef std::pair<fef::TermFieldHandle, query::Weight> Element; + using Element = std::pair<fef::TermFieldHandle, query::Weight>; std::vector<Element> _terms; const fef::MatchData *_md; diff --git a/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp b/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp index 495bb766e32..b11998d8c1e 100644 --- a/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/text_similarity_feature.cpp @@ -86,7 +86,7 @@ TextSimilarityExecutor::TextSimilarityExecutor(const fef::IQueryEnvironment &env for (uint32_t i = 0; i < env.getNumTerms(); ++i) { const fef::ITermData *termData = env.getTerm(i); if (termData->getWeight().percent() != 0) { // only consider query terms with contribution - typedef fef::ITermFieldRangeAdapter FRA; + using FRA = fef::ITermFieldRangeAdapter; for (FRA iter(*termData); iter.valid(); iter.next()) { const fef::ITermFieldData &tfd = iter.get(); if (tfd.getFieldId() == field_id) { diff --git a/searchlib/src/vespa/searchlib/features/utils.h b/searchlib/src/vespa/searchlib/features/utils.h index 9a8ddacb99f..814705c2fc9 100644 --- a/searchlib/src/vespa/searchlib/features/utils.h +++ b/searchlib/src/vespa/searchlib/features/utils.h @@ -23,7 +23,7 @@ const feature_t FEATURE_MAX = std::numeric_limits<feature_t>::max(); */ const feature_t FEATURE_MIN = -std::numeric_limits<feature_t>::max(); -typedef const char * ConstCharPtr; +using ConstCharPtr = const char *; /** * Converts the given string to a numeric value. diff --git a/searchlib/src/vespa/searchlib/fef/blueprint.h b/searchlib/src/vespa/searchlib/fef/blueprint.h index d4e37f05b91..bfa772d7c6d 100644 --- a/searchlib/src/vespa/searchlib/fef/blueprint.h +++ b/searchlib/src/vespa/searchlib/fef/blueprint.h @@ -53,15 +53,15 @@ public: /** * Convenience typedef for an auto pointer to this class. **/ - typedef std::unique_ptr<Blueprint> UP; + using UP = std::unique_ptr<Blueprint>; /** * Convenience typedef for an shared pointer to this class. **/ - typedef std::shared_ptr<Blueprint> SP; + using SP = std::shared_ptr<Blueprint>; - typedef vespalib::string string; - typedef std::vector<string> StringVector; + using string = vespalib::string; + using StringVector = std::vector<string>; private: string _baseName; diff --git a/searchlib/src/vespa/searchlib/fef/featurenameparser.h b/searchlib/src/vespa/searchlib/fef/featurenameparser.h index 7da4aa8b64d..4c5188fd721 100644 --- a/searchlib/src/vespa/searchlib/fef/featurenameparser.h +++ b/searchlib/src/vespa/searchlib/fef/featurenameparser.h @@ -14,8 +14,8 @@ namespace search::fef { class FeatureNameParser { public: - typedef vespalib::string string; - typedef std::vector<string> StringVector; + using string = vespalib::string; + using StringVector = std::vector<string>; private: bool _valid; uint32_t _endPos; diff --git a/searchlib/src/vespa/searchlib/fef/fieldinfo.h b/searchlib/src/vespa/searchlib/fef/fieldinfo.h index d1613ffaafb..a0bf79f0fee 100644 --- a/searchlib/src/vespa/searchlib/fef/fieldinfo.h +++ b/searchlib/src/vespa/searchlib/fef/fieldinfo.h @@ -19,7 +19,7 @@ class FieldInfo public: using CollectionType = search::index::schema::CollectionType; using DataType = search::index::schema::DataType; - typedef vespalib::string string; + using string = vespalib::string; private: FieldType _type; DataType _data_type; diff --git a/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.h b/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.h index 1aee300b805..e319a00056e 100644 --- a/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.h +++ b/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.h @@ -17,7 +17,7 @@ public: * The iterator type of the underlying data, which have all * positions for a term across all fields searched. **/ - typedef const TermFieldMatchDataPosition * PositionsIterator; + using PositionsIterator = const TermFieldMatchDataPosition *; private: uint32_t _length; diff --git a/searchlib/src/vespa/searchlib/fef/handle.h b/searchlib/src/vespa/searchlib/fef/handle.h index b3cc3be2c29..6276de54e0a 100644 --- a/searchlib/src/vespa/searchlib/fef/handle.h +++ b/searchlib/src/vespa/searchlib/fef/handle.h @@ -6,8 +6,8 @@ namespace search::fef { -typedef uint32_t FeatureHandle; -typedef uint32_t TermFieldHandle; +using FeatureHandle = uint32_t; +using TermFieldHandle = uint32_t; const uint32_t IllegalHandle = 0xffffffff; diff --git a/searchlib/src/vespa/searchlib/fef/iindexenvironment.h b/searchlib/src/vespa/searchlib/fef/iindexenvironment.h index 35158d046da..0cb4ce5218d 100644 --- a/searchlib/src/vespa/searchlib/fef/iindexenvironment.h +++ b/searchlib/src/vespa/searchlib/fef/iindexenvironment.h @@ -21,7 +21,7 @@ class OnnxModel; class IIndexEnvironment { public: - typedef vespalib::string string; + using string = vespalib::string; /** * This enum defines the different motivations the framework has * for configuring a feature blueprint. RANK means the feature is diff --git a/searchlib/src/vespa/searchlib/fef/iqueryenvironment.h b/searchlib/src/vespa/searchlib/fef/iqueryenvironment.h index f01ca3ace77..7495bba8b3b 100644 --- a/searchlib/src/vespa/searchlib/fef/iqueryenvironment.h +++ b/searchlib/src/vespa/searchlib/fef/iqueryenvironment.h @@ -23,7 +23,7 @@ public: /** * Convenience typedef. **/ - typedef std::shared_ptr<IQueryEnvironment> SP; + using SP = std::shared_ptr<IQueryEnvironment>; /** Convenience typedef. */ using GeoLocationSpecPtrs = std::vector<const search::common::GeoLocationSpec *>; diff --git a/searchlib/src/vespa/searchlib/fef/itablefactory.h b/searchlib/src/vespa/searchlib/fef/itablefactory.h index b9ce730f738..b023f3c85c4 100644 --- a/searchlib/src/vespa/searchlib/fef/itablefactory.h +++ b/searchlib/src/vespa/searchlib/fef/itablefactory.h @@ -16,7 +16,7 @@ public: /** * Convenience typedef for a shared pointer to this class. **/ - typedef std::shared_ptr<ITableFactory> SP; + using SP = std::shared_ptr<ITableFactory>; /** * Creates a table with the given name. diff --git a/searchlib/src/vespa/searchlib/fef/matchdata.h b/searchlib/src/vespa/searchlib/fef/matchdata.h index 924f07dd8c1..bcc3311c2b3 100644 --- a/searchlib/src/vespa/searchlib/fef/matchdata.h +++ b/searchlib/src/vespa/searchlib/fef/matchdata.h @@ -46,7 +46,7 @@ public: /** * Convenience typedef for an auto-pointer to this class. **/ - typedef std::unique_ptr<MatchData> UP; + using UP = std::unique_ptr<MatchData>; /** * Create a new object with the given number of term, attribute, and feature diff --git a/searchlib/src/vespa/searchlib/fef/objectstore.h b/searchlib/src/vespa/searchlib/fef/objectstore.h index c587b7b144a..06575c61eb5 100644 --- a/searchlib/src/vespa/searchlib/fef/objectstore.h +++ b/searchlib/src/vespa/searchlib/fef/objectstore.h @@ -12,7 +12,7 @@ namespace search::fef { class Anything { public: - typedef std::unique_ptr<Anything> UP; + using UP = std::unique_ptr<Anything>; virtual ~Anything() { } }; @@ -52,7 +52,7 @@ public: void add(const vespalib::string & key, Anything::UP value) override; const Anything * get(const vespalib::string & key) const override; private: - typedef vespalib::hash_map<vespalib::string, Anything *> ObjectMap; + using ObjectMap = vespalib::hash_map<vespalib::string, Anything *>; ObjectMap _objectMap; }; diff --git a/searchlib/src/vespa/searchlib/fef/parameter.h b/searchlib/src/vespa/searchlib/fef/parameter.h index 97c04cdf50f..a0d9474d57f 100644 --- a/searchlib/src/vespa/searchlib/fef/parameter.h +++ b/searchlib/src/vespa/searchlib/fef/parameter.h @@ -32,6 +32,6 @@ public: const search::fef::FieldInfo * asField() const { return _fieldVal; } }; -typedef std::vector<Parameter> ParameterList; +using ParameterList = std::vector<Parameter>; } diff --git a/searchlib/src/vespa/searchlib/fef/parameterdescriptions.h b/searchlib/src/vespa/searchlib/fef/parameterdescriptions.h index 000dc241202..ec39e7bdf09 100644 --- a/searchlib/src/vespa/searchlib/fef/parameterdescriptions.h +++ b/searchlib/src/vespa/searchlib/fef/parameterdescriptions.h @@ -154,7 +154,7 @@ public: bool hasRepeat() const { return _repeat != 0; } size_t getRepeat() const { return _repeat; } }; - typedef std::vector<Description> DescriptionVector; + using DescriptionVector = std::vector<Description>; private: DescriptionVector _descriptions; diff --git a/searchlib/src/vespa/searchlib/fef/parametervalidator.h b/searchlib/src/vespa/searchlib/fef/parametervalidator.h index dc92c6a2071..9da95f8aae0 100644 --- a/searchlib/src/vespa/searchlib/fef/parametervalidator.h +++ b/searchlib/src/vespa/searchlib/fef/parametervalidator.h @@ -16,8 +16,8 @@ namespace search::fef { */ class ParameterValidator { public: - typedef vespalib::string string; - typedef std::vector<string> StringVector; + using string = vespalib::string; + using StringVector = std::vector<string>; /** * This class contains the result after running a validation for a given parameter description. * If the result is valid the parameter description matched the string parameter list diff --git a/searchlib/src/vespa/searchlib/fef/phrase_splitter_query_env.cpp b/searchlib/src/vespa/searchlib/fef/phrase_splitter_query_env.cpp index aaf23ed6744..02b1e3616a0 100644 --- a/searchlib/src/vespa/searchlib/fef/phrase_splitter_query_env.cpp +++ b/searchlib/src/vespa/searchlib/fef/phrase_splitter_query_env.cpp @@ -7,7 +7,7 @@ namespace search::fef { void PhraseSplitterQueryEnv::considerTerm(uint32_t termIdx, const ITermData &term, uint32_t fieldId) { - typedef search::fef::ITermFieldRangeAdapter FRA; + using FRA = search::fef::ITermFieldRangeAdapter; for (FRA iter(term); iter.valid(); iter.next()) { if (iter.get().getFieldId() == fieldId) { diff --git a/searchlib/src/vespa/searchlib/fef/properties.h b/searchlib/src/vespa/searchlib/fef/properties.h index 2eca4a27854..a6ae83b0339 100644 --- a/searchlib/src/vespa/searchlib/fef/properties.h +++ b/searchlib/src/vespa/searchlib/fef/properties.h @@ -23,8 +23,8 @@ class Properties; class Property { public: - typedef vespalib::string Value; - typedef std::vector<Value> Values; + using Value = vespalib::string; + using Values = std::vector<Value>; private: friend class Properties; @@ -159,7 +159,7 @@ private: static uint32_t rawHash(const void *buf, uint32_t len); public: - typedef std::unique_ptr<Properties> UP; + using UP = std::unique_ptr<Properties>; /** * Create an empty properties object. diff --git a/searchlib/src/vespa/searchlib/fef/ranksetup.h b/searchlib/src/vespa/searchlib/fef/ranksetup.h index 403b4410537..3d3cb325525 100644 --- a/searchlib/src/vespa/searchlib/fef/ranksetup.h +++ b/searchlib/src/vespa/searchlib/fef/ranksetup.h @@ -90,7 +90,7 @@ public: /** * Convenience typedef for a shared pointer to this class. **/ - typedef std::shared_ptr<RankSetup> SP; + using SP = std::shared_ptr<RankSetup>; /** * Create a new rank setup within the given index environment and diff --git a/searchlib/src/vespa/searchlib/fef/symmetrictable.h b/searchlib/src/vespa/searchlib/fef/symmetrictable.h index c9da96c9460..b524688f45d 100644 --- a/searchlib/src/vespa/searchlib/fef/symmetrictable.h +++ b/searchlib/src/vespa/searchlib/fef/symmetrictable.h @@ -21,7 +21,7 @@ private: double _max; public: - typedef std::shared_ptr<SymmetricTable> SP; + using SP = std::shared_ptr<SymmetricTable>; SymmetricTable(); /** diff --git a/searchlib/src/vespa/searchlib/fef/table.h b/searchlib/src/vespa/searchlib/fef/table.h index e6a712eea59..8d158c67389 100644 --- a/searchlib/src/vespa/searchlib/fef/table.h +++ b/searchlib/src/vespa/searchlib/fef/table.h @@ -18,7 +18,7 @@ private: double _max; public: - typedef std::shared_ptr<Table> SP; + using SP = std::shared_ptr<Table>; /** * Creates a new table with zero elements. diff --git a/searchlib/src/vespa/searchlib/fef/tablemanager.h b/searchlib/src/vespa/searchlib/fef/tablemanager.h index 5c4fc661e50..3abb06e45ff 100644 --- a/searchlib/src/vespa/searchlib/fef/tablemanager.h +++ b/searchlib/src/vespa/searchlib/fef/tablemanager.h @@ -20,7 +20,7 @@ private: TableManager(const TableManager &); TableManager &operator=(const TableManager &); - typedef std::map<vespalib::string, Table::SP> TableCache; + using TableCache = std::map<vespalib::string, Table::SP>; std::vector<ITableFactory::SP> _factories; mutable TableCache _cache; mutable std::mutex _lock; diff --git a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h index f9a1afbd14c..134c4215fc2 100644 --- a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h +++ b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h @@ -19,8 +19,8 @@ class TermMatchDataMerger; class TermFieldMatchData { public: - typedef const TermFieldMatchDataPosition * PositionsIterator; - typedef TermFieldMatchDataPosition * MutablePositionsIterator; + using PositionsIterator = const TermFieldMatchDataPosition *; + using MutablePositionsIterator = TermFieldMatchDataPosition *; struct Positions { TermFieldMatchDataPosition *_positions; uint16_t _maxElementLength; diff --git a/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.h b/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.h index fd015a7d304..6a80ba09979 100644 --- a/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.h +++ b/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.h @@ -20,7 +20,7 @@ public: : matchData(arg_matchData), exactness(arg_exactness) {} }; - typedef std::vector<Input> Inputs; + using Inputs = std::vector<Input>; private: std::vector<Inputs> _inputs; const TermFieldMatchDataArray _output; diff --git a/searchlib/src/vespa/searchlib/fef/test/ftlib.cpp b/searchlib/src/vespa/searchlib/fef/test/ftlib.cpp index 879f3a97cfa..bd627258c66 100644 --- a/searchlib/src/vespa/searchlib/fef/test/ftlib.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/ftlib.cpp @@ -57,8 +57,8 @@ FtFeatureTest::~FtFeatureTest() {} std::vector<vespalib::string> FtUtil::tokenize(const vespalib::string & str, const vespalib::string & separator) { - typedef boost::tokenizer<boost::char_separator<char> > Tokenizer; - typedef boost::char_separator<char> Separator; + using Tokenizer = boost::tokenizer<boost::char_separator<char> >; + using Separator = boost::char_separator<char>; std::vector<vespalib::string> retval; if (separator != vespalib::string("")) { diff --git a/searchlib/src/vespa/searchlib/fef/test/ftlib.h b/searchlib/src/vespa/searchlib/fef/test/ftlib.h index d4a18fcd40e..27e23fbbfdc 100644 --- a/searchlib/src/vespa/searchlib/fef/test/ftlib.h +++ b/searchlib/src/vespa/searchlib/fef/test/ftlib.h @@ -140,8 +140,8 @@ struct FtQueryTerm { } }; -typedef std::vector<FtQueryTerm> FtQuery; -typedef std::map<vespalib::string, std::vector<vespalib::string> > StringVectorMap; +using FtQuery = std::vector<FtQueryTerm>; +using StringVectorMap = std::map<vespalib::string, std::vector<vespalib::string> >; //--------------------------------------------------------------------------------------------------------------------- // FtUtil @@ -160,14 +160,14 @@ public: //--------------------------------------------------------------------------------------------------------------------- struct FtIndex { struct Element { - typedef std::vector<vespalib::string> Tokens; + using Tokens = std::vector<vespalib::string>; int32_t weight; Tokens tokens; Element(int32_t w, const Tokens &t) : weight(w), tokens(t) {} }; - typedef std::vector<Element> Field; - typedef std::map<vespalib::string, Field> FieldMap; + using Field = std::vector<Element>; + using FieldMap = std::map<vespalib::string, Field>; FieldMap index; // raw content of all fields vespalib::string cursor; // last referenced field FtIndex() : index(), cursor() {} @@ -188,7 +188,7 @@ struct FtIndex { // FtTestApp //--------------------------------------------------------------------------------------------------------------------- struct FtTestApp : public vespalib::TestApp { - typedef vespalib::string string; + using string = vespalib::string; static void FT_SETUP_FAIL(const search::fef::Blueprint &prototype, const StringList ¶ms); static void FT_SETUP_FAIL(const search::fef::Blueprint &prototype, const search::fef::test::IndexEnvironment &env, const StringList ¶ms); diff --git a/searchlib/src/vespa/searchlib/fef/test/matchdatabuilder.h b/searchlib/src/vespa/searchlib/fef/test/matchdatabuilder.h index f2a1efac751..724a551927c 100644 --- a/searchlib/src/vespa/searchlib/fef/test/matchdatabuilder.h +++ b/searchlib/src/vespa/searchlib/fef/test/matchdatabuilder.h @@ -53,11 +53,11 @@ public: /** * Convenience typedefs. */ - typedef std::unique_ptr<MatchDataBuilder> UP; - typedef std::map<uint32_t, MyField> IndexData; // index data per field - typedef std::set<Position> Positions; // match information for a single term and field combination - typedef std::map<uint32_t, Positions> FieldPositions; // position information per field for a single term - typedef std::map<uint32_t, FieldPositions> TermMap; // maps term id to map of position information per field + using UP = std::unique_ptr<MatchDataBuilder>; + using IndexData = std::map<uint32_t, MyField>; // index data per field + using Positions = std::set<Position>; // match information for a single term and field combination + using FieldPositions = std::map<uint32_t, Positions>; // position information per field for a single term + using TermMap = std::map<uint32_t, FieldPositions>; // maps term id to map of position information per field public: /** diff --git a/searchlib/src/vespa/searchlib/fef/test/plugin/sum.cpp b/searchlib/src/vespa/searchlib/fef/test/plugin/sum.cpp index a6a6f86c39c..67055ebf03f 100644 --- a/searchlib/src/vespa/searchlib/fef/test/plugin/sum.cpp +++ b/searchlib/src/vespa/searchlib/fef/test/plugin/sum.cpp @@ -30,7 +30,7 @@ SumBlueprint::visitDumpFeatures(const IIndexEnvironment & indexEnv, IDumpFeature (void) visitor; #else // Use the feature name builder to make sure that the naming of features are quoted correctly. - typedef FeatureNameBuilder FNB; + using FNB = FeatureNameBuilder; // This blueprint dumps 2 ranking features. This is a very tricky feature in that it's dependencies // are given by its parameters, so the definition of features implicitly declares this tree. This diff --git a/searchlib/src/vespa/searchlib/fef/test/rankresult.h b/searchlib/src/vespa/searchlib/fef/test/rankresult.h index a31fdff5606..ccdbb6af98c 100644 --- a/searchlib/src/vespa/searchlib/fef/test/rankresult.h +++ b/searchlib/src/vespa/searchlib/fef/test/rankresult.h @@ -13,7 +13,7 @@ public: /** * Convenience typedefs. */ - typedef std::map<vespalib::string, feature_t> RankScores; + using RankScores = std::map<vespalib::string, feature_t>; public: /** diff --git a/searchlib/src/vespa/searchlib/grouping/collect.h b/searchlib/src/vespa/searchlib/grouping/collect.h index 55b5ea3ddd4..5c27fd7e431 100644 --- a/searchlib/src/vespa/searchlib/grouping/collect.h +++ b/searchlib/src/vespa/searchlib/grouping/collect.h @@ -86,8 +86,8 @@ private: mutable vespalib::IdentifiablePtr<aggregation::AggregationResult> _aggregator; uint32_t _offset; }; - typedef vespalib::Array<uint8_t> AggregatorBacking; - typedef vespalib::Array<ResultAccessor> ResultAccessorList; + using AggregatorBacking = vespalib::Array<uint8_t>; + using ResultAccessorList = vespalib::Array<ResultAccessor>; class SortInfo { public: SortInfo() noexcept : _index(0), _sign(1) { } diff --git a/searchlib/src/vespa/searchlib/grouping/groupengine.h b/searchlib/src/vespa/searchlib/grouping/groupengine.h index 8396f7fc9e2..a3c3bf742cb 100644 --- a/searchlib/src/vespa/searchlib/grouping/groupengine.h +++ b/searchlib/src/vespa/searchlib/grouping/groupengine.h @@ -56,7 +56,7 @@ public: const GroupEngine & _engine; }; - typedef vespalib::hash_set<GroupRef, GroupHash, GroupEqual> Children; + using Children = vespalib::hash_set<GroupRef, GroupHash, GroupEqual>; /** * @param request The request creating this engine. diff --git a/searchlib/src/vespa/searchlib/grouping/groupingengine.h b/searchlib/src/vespa/searchlib/grouping/groupingengine.h index 1b696996e37..83f34c3d98a 100644 --- a/searchlib/src/vespa/searchlib/grouping/groupingengine.h +++ b/searchlib/src/vespa/searchlib/grouping/groupingengine.h @@ -9,7 +9,7 @@ namespace search::grouping { class GroupingEngine { public: - typedef std::vector<GroupEngine *> GroupEngines; + using GroupEngines = std::vector<GroupEngine *>; public: GroupingEngine(const GroupingEngine &) = delete; GroupingEngine & operator = (const GroupingEngine &) = delete; diff --git a/searchlib/src/vespa/searchlib/grouping/hyperloglog.h b/searchlib/src/vespa/searchlib/grouping/hyperloglog.h index 4e61831a8b7..9a77fd54a93 100644 --- a/searchlib/src/vespa/searchlib/grouping/hyperloglog.h +++ b/searchlib/src/vespa/searchlib/grouping/hyperloglog.h @@ -51,7 +51,7 @@ class HyperLogLog { typename Sketch<BucketBits, HashT>::UP _sketch; public: - typedef HashT hash_type; + using hash_type = HashT; enum { bucketBits = BucketBits }; // Initialize ExchangerSketch with a reference to _sketch. @@ -80,8 +80,8 @@ public: template <int BucketBits, typename HashT> void HyperLogLog<BucketBits, HashT>:: merge(const HyperLogLog<BucketBits, HashT> &other) { - typedef SparseSketch<BucketBits, HashT> Sparse; - typedef NormalSketch<BucketBits, HashT> Normal; + using Sparse = SparseSketch<BucketBits, HashT>; + using Normal = NormalSketch<BucketBits, HashT>; if (_sketch->getClassId() == Sparse::classId) { Sparse &sparse = static_cast<Sparse &>(*_sketch); diff --git a/searchlib/src/vespa/searchlib/grouping/sketch.h b/searchlib/src/vespa/searchlib/grouping/sketch.h index 149f24c108f..380145e6f34 100644 --- a/searchlib/src/vespa/searchlib/grouping/sketch.h +++ b/searchlib/src/vespa/searchlib/grouping/sketch.h @@ -24,9 +24,9 @@ template <int BucketBits, typename HashT> struct NormalSketch; template <int BucketBits, typename HashT> struct Sketch { enum { bucketBits = BucketBits }; - typedef HashT hash_type; - typedef Sketch<BucketBits, HashT> SketchType; - typedef std::unique_ptr<SketchType> UP; + using hash_type = HashT; + using SketchType = Sketch<BucketBits, HashT>; + using UP = std::unique_ptr<SketchType>; static const HashT BUCKET_COUNT = HashT(1) << BucketBits; static const HashT BUCKET_MASK = BUCKET_COUNT - 1; @@ -128,7 +128,7 @@ struct NormalSketch : Sketch<BucketBits, HashT> { using typename Sketch<BucketBits, HashT>::SketchType; using Sketch<BucketBits, HashT>::BUCKET_COUNT; using Sketch<BucketBits, HashT>::BUCKET_MASK; - typedef std::unique_ptr<NormalSketch> UP; + using UP = std::unique_ptr<NormalSketch>; enum { classId = IDENTIFIABLE_CLASSID_NS(search, NormalSketch) }; uint8_t bucket[BUCKET_COUNT]; diff --git a/searchlib/src/vespa/searchlib/index/dummyfileheadercontext.cpp b/searchlib/src/vespa/searchlib/index/dummyfileheadercontext.cpp index 44354fc9ad3..c1f37e2ade3 100644 --- a/searchlib/src/vespa/searchlib/index/dummyfileheadercontext.cpp +++ b/searchlib/src/vespa/searchlib/index/dummyfileheadercontext.cpp @@ -35,7 +35,7 @@ void DummyFileHeaderContext::addTags(vespalib::GenericHeader &header, const vespalib::string &name) const { - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; FileHeaderTk::addVersionTags(header); if (!_disableFileName) { diff --git a/searchlib/src/vespa/searchlib/index/postinglistfile.h b/searchlib/src/vespa/searchlib/index/postinglistfile.h index a33319e1d4f..17bfb47b812 100644 --- a/searchlib/src/vespa/searchlib/index/postinglistfile.h +++ b/searchlib/src/vespa/searchlib/index/postinglistfile.h @@ -134,7 +134,7 @@ protected: // Can be examined after open bool _memoryMapped; public: - typedef std::shared_ptr<PostingListFileRandRead> SP; + using SP = std::shared_ptr<PostingListFileRandRead>; PostingListFileRandRead(); virtual ~PostingListFileRandRead(); diff --git a/searchlib/src/vespa/searchlib/index/postinglisthandle.h b/searchlib/src/vespa/searchlib/index/postinglisthandle.h index 86d283df537..9a4ec212636 100644 --- a/searchlib/src/vespa/searchlib/index/postinglisthandle.h +++ b/searchlib/src/vespa/searchlib/index/postinglisthandle.h @@ -20,7 +20,7 @@ class PostingListFileRandRead; */ class PostingListHandle { public: - typedef std::unique_ptr<PostingListHandle> UP; + using UP = std::unique_ptr<PostingListHandle>; // Key portion PostingListFileRandRead *_file; // File containing posting list uint64_t _bitOffset; // posting list start relative to start of file diff --git a/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp b/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp index f6b72347c5d..604a467a6e6 100644 --- a/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp +++ b/searchlib/src/vespa/searchlib/predicate/document_features_store.cpp @@ -55,7 +55,7 @@ deserializeWords(DataBuffer &buffer, memoryindex::WordStore &word_store, WordInd template <typename RangeFeaturesMap> void deserializeRanges(DataBuffer &buffer, vector<EntryRef> &word_refs, RangeFeaturesMap &ranges, size_t &num_ranges) { - typedef typename RangeFeaturesMap::mapped_type::value_type Range; + using Range = typename RangeFeaturesMap::mapped_type::value_type; uint32_t ranges_size = buffer.readInt32(); for (uint32_t i = 0; i < ranges_size; ++i) { uint32_t doc_id = buffer.readInt32(); diff --git a/searchlib/src/vespa/searchlib/predicate/document_features_store.h b/searchlib/src/vespa/searchlib/predicate/document_features_store.h index b5947d506f9..4721ff520ce 100644 --- a/searchlib/src/vespa/searchlib/predicate/document_features_store.h +++ b/searchlib/src/vespa/searchlib/predicate/document_features_store.h @@ -18,7 +18,7 @@ namespace search::predicate { * lists of the dictionary. */ class DocumentFeaturesStore { - typedef memoryindex::WordStore WordStore; + using WordStore = memoryindex::WordStore; struct Range { vespalib::datastore::EntryRef label_ref; int64_t from; @@ -46,12 +46,12 @@ class DocumentFeaturesStore { return strcmp(getWord(lhs), getWord(rhs)) < 0; } }; - typedef vespalib::Array<uint64_t> FeatureVector; - typedef vespalib::hash_map<uint32_t, FeatureVector> DocumentFeaturesMap; - typedef vespalib::Array<Range> RangeVector; - typedef vespalib::hash_map<uint32_t, RangeVector> RangeFeaturesMap; - typedef vespalib::btree::BTree<vespalib::datastore::EntryRef, vespalib::btree::BTreeNoLeafData, - vespalib::btree::NoAggregated, const KeyComp &> WordIndex; + using FeatureVector = vespalib::Array<uint64_t>; + using DocumentFeaturesMap = vespalib::hash_map<uint32_t, FeatureVector>; + using RangeVector = vespalib::Array<Range>; + using RangeFeaturesMap = vespalib::hash_map<uint32_t, RangeVector>; + using WordIndex = vespalib::btree::BTree<vespalib::datastore::EntryRef, vespalib::btree::BTreeNoLeafData, + vespalib::btree::NoAggregated, const KeyComp &>; DocumentFeaturesMap _docs; RangeFeaturesMap _ranges; @@ -66,7 +66,7 @@ class DocumentFeaturesStore { void setCurrent(uint32_t docId, FeatureVector *features); public: - typedef std::unordered_set<uint64_t> FeatureSet; + using FeatureSet = std::unordered_set<uint64_t>; DocumentFeaturesStore(uint32_t arity); DocumentFeaturesStore(vespalib::DataBuffer &buffer); diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_index.h b/searchlib/src/vespa/searchlib/predicate/predicate_index.h index 238314e17f9..4f1281a649f 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_index.h +++ b/searchlib/src/vespa/searchlib/predicate/predicate_index.h @@ -23,8 +23,8 @@ struct PredicateTreeAnnotations; * posting lists for matching. */ class PredicateIndex : public PopulateInterface { - typedef SimpleIndex<vespalib::datastore::EntryRef> IntervalIndex; - typedef SimpleIndex<vespalib::datastore::EntryRef> BoundsIndex; + using IntervalIndex = SimpleIndex<vespalib::datastore::EntryRef>; + using BoundsIndex = SimpleIndex<vespalib::datastore::EntryRef>; template <typename IntervalT> using FeatureMap = std::unordered_map<uint64_t, std::vector<IntervalT>>; using generation_t = vespalib::GenerationHandler::generation_t; @@ -32,9 +32,9 @@ class PredicateIndex : public PopulateInterface { using optional = std::optional<T>; public: - typedef std::unique_ptr<PredicateIndex> UP; - typedef vespalib::GenerationHandler GenerationHandler; - typedef vespalib::GenerationHolder GenerationHolder; + using UP = std::unique_ptr<PredicateIndex>; + using GenerationHandler = vespalib::GenerationHandler; + using GenerationHolder = vespalib::GenerationHolder; using BTreeIterator = SimpleIndex<vespalib::datastore::EntryRef>::BTreeIterator; using VectorIterator = SimpleIndex<vespalib::datastore::EntryRef>::VectorIterator; private: diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_ref_cache.h b/searchlib/src/vespa/searchlib/predicate/predicate_ref_cache.h index d001ecddb71..96d1af09c0d 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_ref_cache.h +++ b/searchlib/src/vespa/searchlib/predicate/predicate_ref_cache.h @@ -118,7 +118,7 @@ public: */ template <typename BufferStore, int SIZE_BITS = 8> class PredicateRefCache { - typedef RefCacheComparator<BufferStore, SIZE_BITS> ComparatorType; + using ComparatorType = RefCacheComparator<BufferStore, SIZE_BITS>; mutable CurrentZeroRef _current_zero_ref; std::set<uint32_t, ComparatorType> _ref_cache; diff --git a/searchlib/src/vespa/searchlib/query/base.h b/searchlib/src/vespa/searchlib/query/base.h index 733e7d1ce40..6b86e223d36 100644 --- a/searchlib/src/vespa/searchlib/query/base.h +++ b/searchlib/src/vespa/searchlib/query/base.h @@ -4,11 +4,11 @@ namespace search { /// Type of general unsigned 8 bit data. -typedef unsigned char byte; +using byte = unsigned char; /// The type of the local documentId. -typedef unsigned DocumentIdT; +using DocumentIdT = unsigned; /// How time type. Used to represent seconds since 1970. -typedef unsigned TimeT; +using TimeT = unsigned; /// This is a 16 byte vector used in SSE2 integer operations. typedef char v16qi __attribute__ ((__vector_size__(16))); /// This is a 2 element uint64_t vector used in SSE2 integer operations. diff --git a/searchlib/src/vespa/searchlib/query/query_term_simple.h b/searchlib/src/vespa/searchlib/query/query_term_simple.h index b84813cd12e..74728ab1f2e 100644 --- a/searchlib/src/vespa/searchlib/query/query_term_simple.h +++ b/searchlib/src/vespa/searchlib/query/query_term_simple.h @@ -12,9 +12,9 @@ namespace search { */ class QueryTermSimple { public: - typedef std::unique_ptr<QueryTermSimple> UP; - typedef vespalib::string string; - typedef vespalib::stringref stringref; + using UP = std::unique_ptr<QueryTermSimple>; + using string = vespalib::string; + using stringref = vespalib::stringref; enum class Type : uint8_t { WORD = 0, PREFIXTERM = 1, diff --git a/searchlib/src/vespa/searchlib/query/streaming/hit.h b/searchlib/src/vespa/searchlib/query/streaming/hit.h index 4e0407d2bc1..fdfb8730329 100644 --- a/searchlib/src/vespa/searchlib/query/streaming/hit.h +++ b/searchlib/src/vespa/searchlib/query/streaming/hit.h @@ -27,6 +27,6 @@ private: int32_t _weight; }; -typedef std::vector<Hit> HitList; +using HitList = std::vector<Hit>; } diff --git a/searchlib/src/vespa/searchlib/query/streaming/querynode.h b/searchlib/src/vespa/searchlib/query/streaming/querynode.h index 553a2637731..574a3c16ca3 100644 --- a/searchlib/src/vespa/searchlib/query/streaming/querynode.h +++ b/searchlib/src/vespa/searchlib/query/streaming/querynode.h @@ -14,13 +14,13 @@ class QueryNode; class QueryNodeResultFactory; /// Typedef a simple list that contains references to QueryNodes. -typedef std::vector<QueryNode *> QueryNodeRefList; +using QueryNodeRefList = std::vector<QueryNode *>; /// Typedef a simple list that contains const references to QueryNodes. -typedef std::vector<const QueryNode *> ConstQueryNodeRefList; +using ConstQueryNodeRefList = std::vector<const QueryNode *>; /// Typedef a simple list that contains references to QueryTerms. -typedef std::vector<QueryTerm *> QueryTermList; +using QueryTermList = std::vector<QueryTerm *>; /// Typedef a simple list that contains const references to QueryTerms. -typedef std::vector<const QueryTerm *> ConstQueryTermList; +using ConstQueryTermList = std::vector<const QueryTerm *>; /** This is the base of any node in the query tree. Both leaf nodes (terms) @@ -29,7 +29,7 @@ typedef std::vector<const QueryTerm *> ConstQueryTermList; class QueryNode { public: - typedef std::unique_ptr<QueryNode> UP; + using UP = std::unique_ptr<QueryNode>; virtual ~QueryNode() { } /// This evalutes if the subtree starting here evaluates to true. @@ -58,7 +58,7 @@ class QueryNode }; /// A list conating the QuerNode objects. With copy/assignment. -typedef std::vector<QueryNode::UP> QueryNodeList; +using QueryNodeList = std::vector<QueryNode::UP>; } diff --git a/searchlib/src/vespa/searchlib/query/streaming/queryterm.h b/searchlib/src/vespa/searchlib/query/streaming/queryterm.h index af32458c5da..dd9f56b11e1 100644 --- a/searchlib/src/vespa/searchlib/query/streaming/queryterm.h +++ b/searchlib/src/vespa/searchlib/query/streaming/queryterm.h @@ -21,7 +21,7 @@ namespace search::streaming { class QueryTerm : public QueryTermUCS4, public QueryNode { public: - typedef std::unique_ptr<QueryTerm> UP; + using UP = std::unique_ptr<QueryTerm>; class EncodingBitMap { public: diff --git a/searchlib/src/vespa/searchlib/query/tree/customtypevisitor.h b/searchlib/src/vespa/searchlib/query/tree/customtypevisitor.h index abc48db9d87..3c4eff33dbf 100644 --- a/searchlib/src/vespa/searchlib/query/tree/customtypevisitor.h +++ b/searchlib/src/vespa/searchlib/query/tree/customtypevisitor.h @@ -57,32 +57,32 @@ public: private: // Route QueryVisit requests to the correct custom type. - typedef typename NodeTypes::And TAnd; - typedef typename NodeTypes::AndNot TAndNot; - typedef typename NodeTypes::Equiv TEquiv; - typedef typename NodeTypes::NumberTerm TNumberTerm; - typedef typename NodeTypes::LocationTerm TLocTrm; - typedef typename NodeTypes::Near TNear; - typedef typename NodeTypes::ONear TONear; - typedef typename NodeTypes::Or TOr; - typedef typename NodeTypes::Phrase TPhrase; - typedef typename NodeTypes::SameElement TSameElement; - typedef typename NodeTypes::PrefixTerm TPrefixTerm; - typedef typename NodeTypes::RangeTerm TRangeTerm; - typedef typename NodeTypes::Rank TRank; - typedef typename NodeTypes::StringTerm TStringTerm; - typedef typename NodeTypes::SubstringTerm TSubstrTr; - typedef typename NodeTypes::SuffixTerm TSuffixTerm; - typedef typename NodeTypes::WeakAnd TWeakAnd; - typedef typename NodeTypes::WeightedSetTerm TWeightedSetTerm; - typedef typename NodeTypes::DotProduct TDotProduct; - typedef typename NodeTypes::WandTerm TWandTerm; - typedef typename NodeTypes::PredicateQuery TPredicateQuery; - typedef typename NodeTypes::RegExpTerm TRegExpTerm; - typedef typename NodeTypes::NearestNeighborTerm TNearestNeighborTerm; - typedef typename NodeTypes::TrueQueryNode TTrueQueryNode; - typedef typename NodeTypes::FalseQueryNode TFalseQueryNode; - typedef typename NodeTypes::FuzzyTerm TFuzzyTerm; + using TAnd = typename NodeTypes::And; + using TAndNot = typename NodeTypes::AndNot; + using TEquiv = typename NodeTypes::Equiv; + using TNumberTerm = typename NodeTypes::NumberTerm; + using TLocTrm = typename NodeTypes::LocationTerm; + using TNear = typename NodeTypes::Near; + using TONear = typename NodeTypes::ONear; + using TOr = typename NodeTypes::Or; + using TPhrase = typename NodeTypes::Phrase; + using TSameElement = typename NodeTypes::SameElement; + using TPrefixTerm = typename NodeTypes::PrefixTerm; + using TRangeTerm = typename NodeTypes::RangeTerm; + using TRank = typename NodeTypes::Rank; + using TStringTerm = typename NodeTypes::StringTerm; + using TSubstrTr = typename NodeTypes::SubstringTerm; + using TSuffixTerm = typename NodeTypes::SuffixTerm; + using TWeakAnd = typename NodeTypes::WeakAnd; + using TWeightedSetTerm = typename NodeTypes::WeightedSetTerm; + using TDotProduct = typename NodeTypes::DotProduct; + using TWandTerm = typename NodeTypes::WandTerm; + using TPredicateQuery = typename NodeTypes::PredicateQuery; + using TRegExpTerm = typename NodeTypes::RegExpTerm; + using TNearestNeighborTerm = typename NodeTypes::NearestNeighborTerm; + using TTrueQueryNode = typename NodeTypes::TrueQueryNode; + using TFalseQueryNode = typename NodeTypes::FalseQueryNode; + using TFuzzyTerm = typename NodeTypes::FuzzyTerm; void visit(And &n) override { visit(static_cast<TAnd&>(n)); } void visit(AndNot &n) override { visit(static_cast<TAndNot&>(n)); } diff --git a/searchlib/src/vespa/searchlib/query/tree/intermediate.h b/searchlib/src/vespa/searchlib/query/tree/intermediate.h index 0db9997760d..83e804a85cb 100644 --- a/searchlib/src/vespa/searchlib/query/tree/intermediate.h +++ b/searchlib/src/vespa/searchlib/query/tree/intermediate.h @@ -10,7 +10,7 @@ class Intermediate : public Node { std::vector<Node *> _children; public: - typedef std::unique_ptr<Intermediate> UP; + using UP = std::unique_ptr<Intermediate>; Intermediate(const Intermediate & rhs) = delete; Intermediate & operator = (const Intermediate & rhs) = delete; diff --git a/searchlib/src/vespa/searchlib/query/tree/node.h b/searchlib/src/vespa/searchlib/query/tree/node.h index cbf3504b09b..af9925e2ea3 100644 --- a/searchlib/src/vespa/searchlib/query/tree/node.h +++ b/searchlib/src/vespa/searchlib/query/tree/node.h @@ -13,7 +13,7 @@ struct QueryVisitor; */ class Node { public: - typedef std::unique_ptr<Node> UP; + using UP = std::unique_ptr<Node>; virtual ~Node() = default; virtual void accept(QueryVisitor &visitor) = 0; diff --git a/searchlib/src/vespa/searchlib/query/tree/predicate_query_term.h b/searchlib/src/vespa/searchlib/query/tree/predicate_query_term.h index 2c71dddf9cc..b1aec2203f7 100644 --- a/searchlib/src/vespa/searchlib/query/tree/predicate_query_term.h +++ b/searchlib/src/vespa/searchlib/query/tree/predicate_query_term.h @@ -39,7 +39,7 @@ class PredicateQueryTerm { std::vector<Entry<uint64_t>> _range_features; public: - typedef std::unique_ptr<PredicateQueryTerm> UP; + using UP = std::unique_ptr<PredicateQueryTerm>; PredicateQueryTerm() noexcept : _features(), _range_features() {} diff --git a/searchlib/src/vespa/searchlib/query/tree/term.h b/searchlib/src/vespa/searchlib/query/tree/term.h index c48832b6de9..b8ce4fe035d 100644 --- a/searchlib/src/vespa/searchlib/query/tree/term.h +++ b/searchlib/src/vespa/searchlib/query/tree/term.h @@ -50,7 +50,7 @@ class TermBase : public TermNode { T _term; public: - typedef T Type; + using Type = T; ~TermBase() override = 0; const T &getTerm() const { return _term; } diff --git a/searchlib/src/vespa/searchlib/query/tree/termnodes.h b/searchlib/src/vespa/searchlib/query/tree/termnodes.h index 5604a3afb52..578213a15dd 100644 --- a/searchlib/src/vespa/searchlib/query/tree/termnodes.h +++ b/searchlib/src/vespa/searchlib/query/tree/termnodes.h @@ -11,7 +11,7 @@ namespace search::query { -typedef TermBase<vespalib::string> StringBase; +using StringBase = TermBase<vespalib::string>; class NumberTerm : public QueryNodeMixin<NumberTerm, StringBase > { diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp index 91aa308f008..87f7ab99002 100644 --- a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp @@ -460,10 +460,10 @@ IntermediateBlueprint::find(const IPredicate & pred) const FieldSpecBaseList IntermediateBlueprint::mixChildrenFields() const { - typedef std::map<uint32_t, const FieldSpecBase*> Map; - typedef Map::value_type MapVal; - typedef Map::iterator MapPos; - typedef std::pair<MapPos, bool> MapRes; + using Map = std::map<uint32_t, const FieldSpecBase*>; + using MapVal = Map::value_type; + using MapPos = Map::iterator; + using MapRes = std::pair<MapPos, bool>; Map fieldMap; FieldSpecBaseList fieldList; diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.h b/searchlib/src/vespa/searchlib/queryeval/blueprint.h index e7e4741fa3e..2c207253787 100644 --- a/searchlib/src/vespa/searchlib/queryeval/blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.h @@ -309,7 +309,7 @@ protected: const Children& get_children() const { return _children; } public: - typedef std::vector<size_t> IndexList; + using IndexList = std::vector<size_t>; IntermediateBlueprint(); ~IntermediateBlueprint() override; diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp index 34cc343b16d..840ef5eb8de 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp @@ -16,7 +16,7 @@ template <typename HEAP, typename IteratorPack> class DotProductSearchImpl : public DotProductSearch { private: - typedef uint32_t ref_t; + using ref_t = uint32_t; struct CmpDocId { const uint32_t *termPos; @@ -161,8 +161,8 @@ DotProductSearch::create(const std::vector<SearchIterator*> &children, const std::vector<int32_t> &weights, MatchData::UP md) { - typedef DotProductSearchImpl<vespalib::LeftArrayHeap, SearchIteratorPack> ArrayHeapImpl; - typedef DotProductSearchImpl<vespalib::LeftHeap, SearchIteratorPack> HeapImpl; + using ArrayHeapImpl = DotProductSearchImpl<vespalib::LeftArrayHeap, SearchIteratorPack>; + using HeapImpl = DotProductSearchImpl<vespalib::LeftHeap, SearchIteratorPack>; if (childMatch.size() == 1) { return std::make_unique<SingleTermDotProductSearch>(tmd, SearchIterator::UP(children[0]), @@ -182,8 +182,8 @@ DotProductSearch::create(TermFieldMatchData &tmd, const std::vector<int32_t> &weights, std::vector<DocumentWeightIterator> &&iterators) { - typedef DotProductSearchImpl<vespalib::LeftArrayHeap, AttributeIteratorPack> ArrayHeapImpl; - typedef DotProductSearchImpl<vespalib::LeftHeap, AttributeIteratorPack> HeapImpl; + using ArrayHeapImpl = DotProductSearchImpl<vespalib::LeftArrayHeap, AttributeIteratorPack>; + using HeapImpl = DotProductSearchImpl<vespalib::LeftHeap, AttributeIteratorPack>; if (iterators.size() < 128) { return std::make_unique<ArrayHeapImpl>(tmd, field_is_filter, weights, AttributeIteratorPack(std::move(iterators))); diff --git a/searchlib/src/vespa/searchlib/queryeval/equivsearch.h b/searchlib/src/vespa/searchlib/queryeval/equivsearch.h index c72cd676201..0154ab4fe1d 100644 --- a/searchlib/src/vespa/searchlib/queryeval/equivsearch.h +++ b/searchlib/src/vespa/searchlib/queryeval/equivsearch.h @@ -16,7 +16,7 @@ namespace search::queryeval { class EquivSearch : public SearchIterator { public: - typedef MultiSearch::Children Children; + using Children = MultiSearch::Children; static SearchIterator::UP create(Children children, diff --git a/searchlib/src/vespa/searchlib/queryeval/fake_search.cpp b/searchlib/src/vespa/searchlib/queryeval/fake_search.cpp index 2d9db1eb51f..94814dbb9b3 100644 --- a/searchlib/src/vespa/searchlib/queryeval/fake_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/fake_search.cpp @@ -24,9 +24,9 @@ FakeSearch::doSeek(uint32_t docid) void FakeSearch::doUnpack(uint32_t docid) { - typedef fef::TermFieldMatchDataPosition PosCtx; - typedef FakeResult::Document Doc; - typedef FakeResult::Element Elem; + using PosCtx = fef::TermFieldMatchDataPosition; + using Doc = FakeResult::Document; + using Elem = FakeResult::Element; assert(valid()); const Doc &doc = _result.inspect()[_offset]; diff --git a/searchlib/src/vespa/searchlib/queryeval/fake_searchable.h b/searchlib/src/vespa/searchlib/queryeval/fake_searchable.h index a76e23ad87e..c2c4b646dd1 100644 --- a/searchlib/src/vespa/searchlib/queryeval/fake_searchable.h +++ b/searchlib/src/vespa/searchlib/queryeval/fake_searchable.h @@ -15,8 +15,8 @@ namespace search::queryeval { class FakeSearchable : public Searchable { private: - typedef std::pair<vespalib::string, vespalib::string> Key; - typedef std::map<Key, FakeResult> Map; + using Key = std::pair<vespalib::string, vespalib::string>; + using Map = std::map<Key, FakeResult>; vespalib::string _tag; Map _map; diff --git a/searchlib/src/vespa/searchlib/queryeval/hitcollector.h b/searchlib/src/vespa/searchlib/queryeval/hitcollector.h index 54a48e9ce49..fe686f3e0bf 100644 --- a/searchlib/src/vespa/searchlib/queryeval/hitcollector.h +++ b/searchlib/src/vespa/searchlib/queryeval/hitcollector.h @@ -77,7 +77,7 @@ private: class Collector { public: - typedef std::unique_ptr<Collector> UP; + using UP = std::unique_ptr<Collector>; virtual ~Collector() {} virtual void collect(uint32_t docId, feature_t score) = 0; virtual bool isDocIdCollector() const { return false; } diff --git a/searchlib/src/vespa/searchlib/queryeval/isourceselector.h b/searchlib/src/vespa/searchlib/queryeval/isourceselector.h index 35804cd45d9..c247ea8022b 100644 --- a/searchlib/src/vespa/searchlib/queryeval/isourceselector.h +++ b/searchlib/src/vespa/searchlib/queryeval/isourceselector.h @@ -6,7 +6,7 @@ namespace search::queryeval { -typedef uint8_t Source; +using Source = uint8_t; namespace sourceselector { @@ -47,8 +47,8 @@ class ISourceSelector protected: using SourceStore = sourceselector::Iterator::SourceStore; public: - typedef std::unique_ptr<ISourceSelector> UP; - typedef std::shared_ptr<ISourceSelector> SP; + using UP = std::unique_ptr<ISourceSelector>; + using SP = std::shared_ptr<ISourceSelector>; static const Source SOURCE_LIMIT = 254u; protected: diff --git a/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h b/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h index 3d20b79a81d..a19b248fac3 100644 --- a/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h +++ b/searchlib/src/vespa/searchlib/queryeval/monitoring_search_iterator.h @@ -90,7 +90,7 @@ public: void visitNotImplemented() override; }; - typedef std::unique_ptr<MonitoringSearchIterator> UP; + using UP = std::unique_ptr<MonitoringSearchIterator>; private: const vespalib::string _name; diff --git a/searchlib/src/vespa/searchlib/queryeval/multibitvectoriterator.cpp b/searchlib/src/vespa/searchlib/queryeval/multibitvectoriterator.cpp index d69b3486537..4203a6361b2 100644 --- a/searchlib/src/vespa/searchlib/queryeval/multibitvectoriterator.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/multibitvectoriterator.cpp @@ -118,10 +118,10 @@ MultiBitVectorIterator<Update>::strictSeek(uint32_t docId) } -typedef MultiBitVectorIterator<And> AndBVIterator; -typedef MultiBitVectorIteratorStrict<And> AndBVIteratorStrict; -typedef MultiBitVectorIterator<Or> OrBVIterator; -typedef MultiBitVectorIteratorStrict<Or> OrBVIteratorStrict; +using AndBVIterator = MultiBitVectorIterator<And>; +using AndBVIteratorStrict = MultiBitVectorIteratorStrict<And>; +using OrBVIterator = MultiBitVectorIterator<Or>; +using OrBVIteratorStrict = MultiBitVectorIteratorStrict<Or>; bool hasAtLeast2Bitvectors(const MultiSearch::Children & children) { diff --git a/searchlib/src/vespa/searchlib/queryeval/nearsearch.h b/searchlib/src/vespa/searchlib/queryeval/nearsearch.h index bf3fded2717..2701ada94b5 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearsearch.h +++ b/searchlib/src/vespa/searchlib/queryeval/nearsearch.h @@ -17,7 +17,7 @@ protected: uint32_t _window; bool _strict; - typedef search::fef::TermFieldMatchDataArray TermFieldMatchDataArray; + using TermFieldMatchDataArray = search::fef::TermFieldMatchDataArray; class MatcherBase { @@ -43,7 +43,7 @@ protected: /** * Typedef the list of positions iterators because it takes far too much space to write out :-) */ - typedef std::vector<search::fef::TermFieldMatchData::PositionsIterator> PositionsIteratorList; + using PositionsIteratorList = std::vector<search::fef::TermFieldMatchData::PositionsIterator>; /** * Returns whether or not given document matches. This should only be called when all child terms are all diff --git a/searchlib/src/vespa/searchlib/queryeval/orsearch.h b/searchlib/src/vespa/searchlib/queryeval/orsearch.h index f55ce3154ce..73c6f1215b0 100644 --- a/searchlib/src/vespa/searchlib/queryeval/orsearch.h +++ b/searchlib/src/vespa/searchlib/queryeval/orsearch.h @@ -13,7 +13,7 @@ namespace search::queryeval { class OrSearch : public MultiSearch { public: - typedef MultiSearch::Children Children; + using Children = MultiSearch::Children; static SearchIterator::UP create(ChildrenIterators children, bool strict); static SearchIterator::UP create(ChildrenIterators children, bool strict, const UnpackInfo & unpackInfo); diff --git a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp index cf4348ad1bb..a3e5c254e01 100644 --- a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp @@ -30,8 +30,8 @@ using namespace search::predicate; namespace search::queryeval { namespace { -typedef PredicateBlueprint::IntervalEntry IntervalEntry; -typedef PredicateBlueprint::BoundsEntry BoundsEntry; +using IntervalEntry = PredicateBlueprint::IntervalEntry; +using BoundsEntry = PredicateBlueprint::BoundsEntry; template <typename Entry> void pushValueDictionaryEntry(const Entry &entry, diff --git a/searchlib/src/vespa/searchlib/queryeval/predicate_search.h b/searchlib/src/vespa/searchlib/queryeval/predicate_search.h index 4bdc277cbb6..560d6297767 100644 --- a/searchlib/src/vespa/searchlib/queryeval/predicate_search.h +++ b/searchlib/src/vespa/searchlib/queryeval/predicate_search.h @@ -18,7 +18,7 @@ namespace search::queryeval { class SkipMinFeature { public: - typedef std::unique_ptr<SkipMinFeature> UP; + using UP = std::unique_ptr<SkipMinFeature>; virtual ~SkipMinFeature() { } VESPA_DLL_LOCAL virtual uint32_t next() = 0; static SkipMinFeature::UP create(const uint8_t * min_feature, const uint8_t * kv, size_t sz); diff --git a/searchlib/src/vespa/searchlib/queryeval/searchable.h b/searchlib/src/vespa/searchlib/queryeval/searchable.h index a8bdde69b8e..2438cbf5a3b 100644 --- a/searchlib/src/vespa/searchlib/queryeval/searchable.h +++ b/searchlib/src/vespa/searchlib/queryeval/searchable.h @@ -36,7 +36,7 @@ protected: const search::query::Node &term) = 0; public: - typedef std::shared_ptr<Searchable> SP; + using SP = std::shared_ptr<Searchable>; Searchable() = default; diff --git a/searchlib/src/vespa/searchlib/queryeval/searchiterator.h b/searchlib/src/vespa/searchlib/queryeval/searchiterator.h index 38a11b4d960..9ac69735806 100644 --- a/searchlib/src/vespa/searchlib/queryeval/searchiterator.h +++ b/searchlib/src/vespa/searchlib/queryeval/searchiterator.h @@ -175,7 +175,7 @@ public: virtual void and_hits_into(BitVector &result, uint32_t begin_id); public: - typedef std::unique_ptr<SearchIterator> UP; + using UP = std::unique_ptr<SearchIterator>; /** * The constructor sets the current document id to @ref beginId. diff --git a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.h b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.h index 9bc59c6eed4..63e7e7142e3 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.h +++ b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_search.h @@ -23,7 +23,7 @@ class SimplePhraseSearch : public AndSearch fef::TermFieldMatchData &_tmd; bool _strict; - typedef fef::TermFieldMatchData::PositionsIterator It; + using It = fef::TermFieldMatchData::PositionsIterator; // Reuse this vector instead of allocating a new one when needed. std::vector<It> _iterators; diff --git a/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.h b/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.h index bb709f401c5..5040ebbd395 100644 --- a/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.h +++ b/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.h @@ -31,7 +31,7 @@ public: Child() : search(nullptr), sourceId(0) { } Child(SearchIterator *s, uint32_t id) noexcept : search(s), sourceId(id) {} }; - typedef std::vector<Child> Children; + using Children = std::vector<Child>; private: SourceBlenderSearch(const SourceBlenderSearch &); @@ -42,7 +42,7 @@ private: protected: using Iterator = sourceselector::Iterator; using Source = uint8_t; - typedef std::vector<Source> SourceIndex; + using SourceIndex = std::vector<Source>; SearchIterator * _matchedChild; std::unique_ptr<Iterator> _sourceSelector; SourceIndex _children; diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h index 39d2b5a03f0..1a481be5c32 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h @@ -19,7 +19,7 @@ const uint32_t DEFAULT_PARALLEL_WAND_SCORES_ADJUST_FREQUENCY = 4; class ParallelWeakAndBlueprint : public ComplexLeafBlueprint { private: - typedef wand::score_t score_t; + using score_t = wand::score_t; const FieldSpec _field; mutable SharedWeakAndPriorityQueue _scores; diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.cpp b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.cpp index e4645a504bc..292605127fb 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.cpp @@ -13,8 +13,8 @@ using vespalib::make_string; namespace search::queryeval { -typedef ParallelWeakAndSearch::MatchParams MatchParams; -typedef ParallelWeakAndSearch::RankParams RankParams; +using MatchParams = ParallelWeakAndSearch::MatchParams; +using RankParams = ParallelWeakAndSearch::RankParams; namespace wand { @@ -133,7 +133,7 @@ createWand(const wand::Terms &terms, const ParallelWeakAndSearch::MatchParams &matchParams, ParallelWeakAndSearch::RankParams &&rankParams) { - typedef ParallelWeakAndSearchImpl<VectorizedIteratorTerms, FutureHeap, PastHeap, IS_STRICT> WandType; + using WandType = ParallelWeakAndSearchImpl<VectorizedIteratorTerms, FutureHeap, PastHeap, IS_STRICT>; if (should_monitor_wand()) { wand::Terms termsWithMonitoring = insertMonitoringSearchIterator(terms); MonitoringSearchIterator::UP monitoringIterator = diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.h b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.h index 3b5925d2914..77503c07b52 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.h +++ b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_search.h @@ -14,8 +14,8 @@ namespace search::queryeval { */ struct ParallelWeakAndSearch : public SearchIterator { - typedef wand::score_t score_t; - typedef wand::docid_t docid_t; + using score_t = wand::score_t; + using docid_t = wand::docid_t; /** * Params used to tweak the behavior of the WAND algorithm. @@ -57,7 +57,7 @@ struct ParallelWeakAndSearch : public SearchIterator {} }; - typedef wand::Terms Terms; + using Terms = wand::Terms; virtual size_t get_num_terms() const = 0; virtual int32_t get_term_weight(size_t idx) const = 0; diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h b/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h index c735fb239a8..e2f0a78fb52 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h +++ b/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h @@ -20,14 +20,14 @@ namespace search::queryeval::wand { //----------------------------------------------------------------------------- struct Term; -typedef std::vector<Term> Terms; -typedef int64_t score_t; -typedef uint32_t docid_t; -typedef uint16_t ref_t; - -typedef IDocumentWeightAttribute Attr; -typedef Attr::LookupResult AttrDictEntry; -typedef std::vector<AttrDictEntry> AttrDictEntries; +using Terms = std::vector<Term>; +using score_t = int64_t; +using docid_t = uint32_t; +using ref_t = uint16_t; + +using Attr = IDocumentWeightAttribute; +using AttrDictEntry = Attr::LookupResult; +using AttrDictEntries = std::vector<AttrDictEntry>; //----------------------------------------------------------------------------- diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_heap.h b/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_heap.h index 496226b59eb..a6e7d035aa7 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_heap.h +++ b/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_heap.h @@ -16,7 +16,7 @@ namespace search::queryeval { */ class WeakAndHeap { public: - typedef wand::score_t score_t; + using score_t = wand::score_t; WeakAndHeap(uint32_t scoresToTrack) : _minScore((scoresToTrack == 0) ? std::numeric_limits<score_t>::max() @@ -50,7 +50,7 @@ private: class SharedWeakAndPriorityQueue : public WeakAndHeap { private: - typedef vespalib::PriorityQueue<score_t> Scores; + using Scores = vespalib::PriorityQueue<score_t>; Scores _bestScores; std::mutex _lock; diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.cpp b/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.cpp index 6d2ff93ea08..9de799d661b 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.cpp @@ -15,7 +15,7 @@ template <typename FutureHeap, typename PastHeap, bool IS_STRICT> class WeakAndSearchLR : public WeakAndSearch { private: - typedef vespalib::PriorityQueue<score_t> Scores; + using Scores = vespalib::PriorityQueue<score_t>; VectorizedIteratorTerms _terms; DualHeap<FutureHeap, PastHeap> _heaps; diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.h b/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.h index 6406501b75b..1202e0d1889 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.h +++ b/searchlib/src/vespa/searchlib/queryeval/wand/weak_and_search.h @@ -9,7 +9,7 @@ namespace search { namespace queryeval { struct WeakAndSearch : SearchIterator { - typedef wand::Terms Terms; + using Terms = wand::Terms; virtual size_t get_num_terms() const = 0; virtual int32_t get_term_weight(size_t idx) const = 0; virtual wand::score_t get_max_score(size_t idx) const = 0; diff --git a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.cpp b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.cpp index 375f570160a..401f48132ed 100644 --- a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_search.cpp @@ -17,7 +17,7 @@ template <typename HEAP, typename IteratorPack> class WeightedSetTermSearchImpl : public WeightedSetTermSearch { private: - typedef uint32_t ref_t; + using ref_t = uint32_t; struct CmpDocId { const uint32_t *termPos; @@ -168,8 +168,8 @@ WeightedSetTermSearch::create(const std::vector<SearchIterator *> &children, const std::vector<int32_t> &weights, fef::MatchData::UP match_data) { - typedef WeightedSetTermSearchImpl<vespalib::LeftArrayHeap, SearchIteratorPack> ArrayHeapImpl; - typedef WeightedSetTermSearchImpl<vespalib::LeftHeap, SearchIteratorPack> HeapImpl; + using ArrayHeapImpl = WeightedSetTermSearchImpl<vespalib::LeftArrayHeap, SearchIteratorPack>; + using HeapImpl = WeightedSetTermSearchImpl<vespalib::LeftHeap, SearchIteratorPack>; if (children.size() < 128) { return SearchIterator::UP(new ArrayHeapImpl(tmd, field_is_filter, weights, SearchIteratorPack(children, std::move(match_data)))); @@ -185,8 +185,8 @@ WeightedSetTermSearch::create(search::fef::TermFieldMatchData &tmd, const std::vector<int32_t> &weights, std::vector<DocumentWeightIterator> &&iterators) { - typedef WeightedSetTermSearchImpl<vespalib::LeftArrayHeap, AttributeIteratorPack> ArrayHeapImpl; - typedef WeightedSetTermSearchImpl<vespalib::LeftHeap, AttributeIteratorPack> HeapImpl; + using ArrayHeapImpl = WeightedSetTermSearchImpl<vespalib::LeftArrayHeap, AttributeIteratorPack>; + using HeapImpl = WeightedSetTermSearchImpl<vespalib::LeftHeap, AttributeIteratorPack>; if (iterators.size() < 128) { return SearchIterator::UP(new ArrayHeapImpl(tmd, field_is_filter, weights, AttributeIteratorPack(std::move(iterators)))); diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_store.h b/searchlib/src/vespa/searchlib/tensor/tensor_store.h index 9a72d1cfccc..ceebc05a5f9 100644 --- a/searchlib/src/vespa/searchlib/tensor/tensor_store.h +++ b/searchlib/src/vespa/searchlib/tensor/tensor_store.h @@ -27,7 +27,7 @@ class TensorStore : public vespalib::datastore::ICompactable { public: using EntryRef = vespalib::datastore::EntryRef; - typedef vespalib::GenerationHandler::generation_t generation_t; + using generation_t = vespalib::GenerationHandler::generation_t; protected: vespalib::datastore::DataStoreBase& _store; diff --git a/searchlib/src/vespa/searchlib/test/diskindex/threelevelcountbuffers.h b/searchlib/src/vespa/searchlib/test/diskindex/threelevelcountbuffers.h index 9acdbdc9aab..e21fac59123 100644 --- a/searchlib/src/vespa/searchlib/test/diskindex/threelevelcountbuffers.h +++ b/searchlib/src/vespa/searchlib/test/diskindex/threelevelcountbuffers.h @@ -10,7 +10,7 @@ namespace search::diskindex { class ThreeLevelCountWriteBuffers { public: - typedef search::bitcompression::PostingListCountFileEncodeContext EC; + using EC = search::bitcompression::PostingListCountFileEncodeContext; EC &_sse; EC &_spe; EC &_pe; @@ -39,8 +39,8 @@ public: class ThreeLevelCountReadBuffers { public: - typedef search::bitcompression::PostingListCountFileEncodeContext EC; - typedef search::bitcompression::PostingListCountFileDecodeContext DC; + using EC = search::bitcompression::PostingListCountFileEncodeContext; + using DC = search::bitcompression::PostingListCountFileDecodeContext; DC &_ssd; DC &_spd; DC &_pd; diff --git a/searchlib/src/vespa/searchlib/test/fakedata/bitdecode64.h b/searchlib/src/vespa/searchlib/test/fakedata/bitdecode64.h index 56e54980ab3..e0b8f58e2c3 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/bitdecode64.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/bitdecode64.h @@ -13,14 +13,14 @@ class BitDecode64 : public bitcompression::DecodeContext64<bigEndian> private: const uint64_t *_comprBase; int _bitOffsetBase; - typedef bitcompression::DecodeContext64<bigEndian> ParentClass; + using ParentClass = bitcompression::DecodeContext64<bigEndian>; public: using ParentClass::_val; using ParentClass::_valI; using ParentClass::_preRead; using ParentClass::_cacheInt; - typedef typename bitcompression::DecodeContext64<bigEndian>::EC EC; + using EC = typename bitcompression::DecodeContext64<bigEndian>::EC; BitDecode64(const uint64_t *compr, int bitOffset) : bitcompression::DecodeContext64<bigEndian>(compr, bitOffset), @@ -29,7 +29,7 @@ public: { } - typedef bitcompression::DecodeContext64<bigEndian> DC; + using DC = bitcompression::DecodeContext64<bigEndian>; void seek(uint64_t offset) { offset += _bitOffsetBase; @@ -59,6 +59,6 @@ public: extern template class BitDecode64<true>; extern template class BitDecode64<false>; -typedef BitDecode64<true> BitDecode64BE; +using BitDecode64BE = BitDecode64<true>; } diff --git a/searchlib/src/vespa/searchlib/test/fakedata/bitencode64.h b/searchlib/src/vespa/searchlib/test/fakedata/bitencode64.h index 2e1504fca1d..851c4af1030 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/bitencode64.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/bitencode64.h @@ -16,7 +16,7 @@ public: BitEncode64(); ~BitEncode64() override; - typedef bitcompression::EncodeContext64<bigEndian> EC; + using EC = bitcompression::EncodeContext64<bigEndian>; void writeComprBuffer() { _cbuf.writeComprBuffer(true); diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp index be6526ce6cb..e3cf067bd49 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp @@ -155,8 +155,8 @@ setupT(const FakeWord &fw) unsigned int l4SkipCnt = 0; - typedef FakeWord FW; - typedef FW::DocWordFeatureList DWFL; + using FW = FakeWord; + using DWFL = FW::DocWordFeatureList; DWFL::const_iterator d(fw._postings.begin()); DWFL::const_iterator de(fw._postings.end()); @@ -599,8 +599,8 @@ private: FakeFilterOccEGCompressed64ArrayIterator& operator=(const FakeFilterOccEGCompressed64ArrayIterator &other); - typedef BitEncode64<bigEndian> EC; - typedef BitDecode64<bigEndian> DC; + using EC = BitEncode64<bigEndian>; + using DC = BitDecode64<bigEndian>; public: DC _docIdBits; @@ -814,7 +814,7 @@ private: FakeFilterOccEGCompressed64SkipArrayIterator& operator=(const FakeFilterOccEGCompressed64SkipArrayIterator &other); - typedef bitcompression::EncodeContext64BE EC; + using EC = bitcompression::EncodeContext64BE; public: BitDecode64BEDocIds _docIdBits; @@ -1467,7 +1467,7 @@ createIterator(const fef::TermFieldMatchDataArray &matchData) const assert(docIdBits.getBitOffset() == 0); assert(docIdBits.getOffset() == 0); - typedef bitcompression::EncodeContext64BE EC; + using EC = bitcompression::EncodeContext64BE; uint32_t myResidue = 0; UC64_FILTEROCC_READ_RESIDUE(docIdBits._val, diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.cpp index db0626effc1..5bd1d2044fe 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakefilterocc.cpp @@ -21,8 +21,8 @@ FakeFilterOcc::FakeFilterOcc(const FakeWord &fw) { std::vector<uint32_t> fake; - typedef FakeWord FW; - typedef FW::DocWordFeatureList DWFL; + using FW = FakeWord; + using DWFL = FW::DocWordFeatureList; DWFL::const_iterator d(fw._postings.begin()); DWFL::const_iterator de(fw._postings.end()); diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp index e918c523fcf..ec476c4f6cf 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.cpp @@ -228,7 +228,7 @@ FakeMemTreeOccMgr::remove(uint32_t wordIdx, uint32_t docId) void FakeMemTreeOccMgr::sortUnflushed() { - typedef std::vector<PendingOp>::iterator I; + using I = std::vector<PendingOp>::iterator; uint32_t seq = 0; for (I i(_unflushed.begin()), ie(_unflushed.end()); i != ie; ++i) { i->setSeq(++seq); @@ -241,7 +241,7 @@ void FakeMemTreeOccMgr::flush() { using Aligner = FeatureStore::Aligner; - typedef std::vector<PendingOp>::iterator I; + using I = std::vector<PendingOp>::iterator; if (_unflushed.empty()) return; @@ -338,7 +338,7 @@ FakeMemTreeOccFactory::make(const FakeWord &fw) void FakeMemTreeOccFactory::setup(const std::vector<const FakeWord *> &fws) { - typedef FakeMemTreeOccMgr::PostingIdx PostingIdx; + using PostingIdx = FakeMemTreeOccMgr::PostingIdx; std::vector<FakeWord::RandomizedReader> r; uint32_t wordIdx = 0; std::vector<const FakeWord *>::const_iterator fwi(fws.begin()); diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.h b/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.h index 290ba1cf140..abc42642e06 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakememtreeocc.h @@ -110,9 +110,9 @@ public: class FakeMemTreeOccFactory : public FPFactory { public: - typedef FakeMemTreeOccMgr::Tree Tree; - typedef FakeMemTreeOccMgr::NodeAllocator NodeAllocator; - typedef index::Schema Schema; + using Tree = FakeMemTreeOccMgr::Tree; + using NodeAllocator = FakeMemTreeOccMgr::NodeAllocator; + using Schema = index::Schema; FakeMemTreeOccMgr _mgr; @@ -139,9 +139,9 @@ public: class FakeMemTreeOcc : public FakePosting { public: - typedef FakeMemTreeOccMgr::Tree Tree; - typedef FakeMemTreeOccMgr::NodeAllocator NodeAllocator; - typedef FakeMemTreeOccMgr::PosOccFieldsParams PosOccFieldsParams; + using Tree = FakeMemTreeOccMgr::Tree; + using NodeAllocator = FakeMemTreeOccMgr::NodeAllocator; + using PosOccFieldsParams = FakeMemTreeOccMgr::PosOccFieldsParams; private: diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeposting.h b/searchlib/src/vespa/searchlib/test/fakedata/fakeposting.h index d7f6a8bbff8..7e32fcc31ad 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeposting.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeposting.h @@ -28,7 +28,7 @@ private: std::string _name; public: - typedef std::shared_ptr<FakePosting> SP; + using SP = std::shared_ptr<FakePosting>; FakePosting(const std::string &name); diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeword.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakeword.cpp index 74eebb51409..f68fb4a9037 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeword.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeword.cpp @@ -318,7 +318,7 @@ FakeWord::fakeupTemps(vespalib::Rand48 &rnd, void FakeWord::setupRandomizer(vespalib::Rand48 &rnd) { - typedef DocWordFeatureList DWFL; + using DWFL = DocWordFeatureList; Randomizer randomAdd; Randomizer randomRem; @@ -378,7 +378,7 @@ FakeWord::setupRandomizer(vespalib::Rand48 &rnd) void FakeWord::addDocIdBias(uint32_t docIdBias) { - typedef DocWordFeatureList DWFL; + using DWFL = DocWordFeatureList; DWFL::iterator d(_postings.begin()); DWFL::iterator de(_postings.end()); for (; d != de; ++d) { @@ -404,9 +404,9 @@ FakeWord::validate(search::queryeval::SearchIterator *iterator, iterator->initFullRange(); uint32_t docId = 0; - typedef DocWordFeatureList DWFL; - typedef DocWordPosFeatureList DWPFL; - typedef TermFieldMatchData::PositionsIterator TMDPI; + using DWFL = DocWordFeatureList; + using DWPFL = DocWordPosFeatureList; + using TMDPI = TermFieldMatchData::PositionsIterator; DWFL::const_iterator d(_postings.begin()); DWFL::const_iterator de(_postings.end()); @@ -484,9 +484,9 @@ FakeWord::validate(search::queryeval::SearchIterator *iterator, iterator->initFullRange(); uint32_t docId = 1; - typedef DocWordFeatureList DWFL; - typedef DocWordPosFeatureList DWPFL; - typedef TermFieldMatchData::PositionsIterator TMDPI; + using DWFL = DocWordFeatureList; + using DWPFL = DocWordPosFeatureList; + using TMDPI = TermFieldMatchData::PositionsIterator; DWFL::const_iterator d(_postings.begin()); DWFL::const_iterator de(_postings.end()); @@ -556,7 +556,7 @@ FakeWord::validate(search::queryeval::SearchIterator *iterator, bool verbose) co iterator->initFullRange(); uint32_t docId = 1; - typedef DocWordFeatureList DWFL; + using DWFL = DocWordFeatureList; DWFL::const_iterator d(_postings.begin()); DWFL::const_iterator de(_postings.end()); @@ -599,9 +599,9 @@ FakeWord::validate(FieldReader &fieldReader, uint32_t presidue; bool unpres; - typedef DocWordFeatureList DWFL; - typedef DocWordPosFeatureList DWPFL; - typedef TermFieldMatchData::PositionsIterator TMDPI; + using DWFL = DocWordFeatureList; + using DWPFL = DocWordPosFeatureList; + using TMDPI = TermFieldMatchData::PositionsIterator; DWFL::const_iterator d(_postings.begin()); DWFL::const_iterator de(_postings.end()); @@ -633,8 +633,8 @@ FakeWord::validate(FieldReader &fieldReader, #else (void) unpres; - typedef WordDocElementFeatures Elements; - typedef WordDocElementWordPosFeatures Positions; + using Elements = WordDocElementFeatures; + using Positions = WordDocElementWordPosFeatures; std::vector<Elements>::const_iterator element = features.elements().begin(); @@ -701,8 +701,8 @@ FakeWord::validate(FieldReader &fieldReader, void FakeWord::validate(const std::vector<uint32_t> &docIds) const { - typedef DocWordFeatureList DWFL; - typedef std::vector<uint32_t> DL; + using DWFL = DocWordFeatureList; + using DL = std::vector<uint32_t>; DWFL::const_iterator d(_postings.begin()); DWFL::const_iterator de(_postings.end()); DL::const_iterator di(docIds.begin()); @@ -721,7 +721,7 @@ FakeWord::validate(const std::vector<uint32_t> &docIds) const void FakeWord::validate(const search::BitVector &bv) const { - typedef DocWordFeatureList DWFL; + using DWFL = DocWordFeatureList; DWFL::const_iterator d(_postings.begin()); DWFL::const_iterator de(_postings.end()); uint32_t bitHits = bv.countTrueBits(); @@ -745,8 +745,8 @@ FakeWord::dump(FieldWriter &fieldWriter, uint32_t residue; DocIdAndPosOccFeatures features; - typedef DocWordFeatureList DWFL; - typedef DocWordPosFeatureList DWPFL; + using DWFL = DocWordFeatureList; + using DWPFL = DocWordPosFeatureList; DWFL::const_iterator d(_postings.begin()); DWFL::const_iterator de(_postings.end()); diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeword.h b/searchlib/src/vespa/searchlib/test/fakedata/fakeword.h index e3d1bf3c531..ff586e3f8e4 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeword.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeword.h @@ -22,7 +22,7 @@ namespace search::fakedata { class FakeWord { public: - typedef bitcompression::PosOccFieldsParams PosOccFieldsParams; + using PosOccFieldsParams = bitcompression::PosOccFieldsParams; class DocWordPosFeature { @@ -42,7 +42,7 @@ public: ~DocWordPosFeature(); }; - typedef std::vector<DocWordPosFeature> DocWordPosFeatureList; + using DocWordPosFeatureList = std::vector<DocWordPosFeature>; class DocWordCollapsedFeature { @@ -66,7 +66,7 @@ public: ~DocWordFeature(); }; - typedef std::vector<DocWordFeature> DocWordFeatureList; + using DocWordFeatureList = std::vector<DocWordFeature>; class Randomizer { diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp index 6630b3d4f00..3caca05669c 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp @@ -65,8 +65,8 @@ FakeZcbFilterOcc::FakeZcbFilterOcc(const FakeWord &fw) uint32_t lastDocId = 0u; - typedef FakeWord FW; - typedef FW::DocWordFeatureList DWFL; + using FW = FakeWord; + using DWFL = FW::DocWordFeatureList; DWFL::const_iterator d(fw._postings.begin()); DWFL::const_iterator de(fw._postings.end()); diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp index 4c7ec7f347b..24c2f82279e 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp @@ -149,9 +149,9 @@ FakeZcFilterOcc::setupT(const FakeWord &fw) PostingListCounts counts; Zc4PostingWriter<bigEndian> writer(counts); - typedef FakeWord FW; - typedef FW::DocWordFeatureList DWFL; - typedef FW::DocWordPosFeatureList DWPFL; + using FW = FakeWord; + using DWFL = FW::DocWordFeatureList; + using DWPFL = FW::DocWordPosFeatureList; DWFL::const_iterator d(fw._postings.begin()); DWFL::const_iterator de(fw._postings.end()); @@ -397,8 +397,8 @@ public: unsigned int _residue; uint32_t _lastDocId; - typedef search::bitcompression::FeatureDecodeContextBE DecodeContext; - typedef search::bitcompression::FeatureEncodeContextBE EncodeContext; + using DecodeContext = search::bitcompression::FeatureDecodeContextBE; + using EncodeContext = search::bitcompression::FeatureEncodeContextBE; DecodeContext _decodeContext; uint32_t _docIdLimit; diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.cpp index d00db8bd098..d705541b3fc 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.cpp @@ -35,8 +35,7 @@ FPFactory::setup(const std::vector<const FakeWord *> &fws) } -typedef std::map<const std::string, FPFactoryMaker *const> -FPFactoryMap; +using FPFactoryMap = std::map<const std::string, FPFactoryMaker *const>; static FPFactoryMap *fpFactoryMap = nullptr; diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.h b/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.h index cc105f4dff5..01a4289e00e 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/fpfactory.h @@ -46,8 +46,7 @@ public: typedef FPFactory *(FPFactoryMaker)(const index::Schema &schema); -typedef std::pair<const std::string, FPFactoryMaker *const> -FPFactoryMapEntry; +using FPFactoryMapEntry = std::pair<const std::string, FPFactoryMaker *const>; template <class F> static FPFactory * diff --git a/searchlib/src/vespa/searchlib/test/initrange.h b/searchlib/src/vespa/searchlib/test/initrange.h index 8c3a685519a..73560383fc2 100644 --- a/searchlib/src/vespa/searchlib/test/initrange.h +++ b/searchlib/src/vespa/searchlib/test/initrange.h @@ -13,10 +13,10 @@ namespace search::test { class InitRangeVerifier { public: - typedef queryeval::SearchIterator SearchIterator; - typedef std::vector<uint32_t> DocIds; - typedef std::pair<uint32_t, uint32_t> Range; - typedef std::vector<Range> Ranges; + using SearchIterator = queryeval::SearchIterator; + using DocIds = std::vector<uint32_t>; + using Range = std::pair<uint32_t, uint32_t>; + using Ranges = std::vector<Range>; static DocIds invert(const DocIds & docIds, uint32_t docIdlimit); static SearchIterator::UP createIterator(const DocIds &docIds, bool strict); diff --git a/searchlib/src/vespa/searchlib/test/mock_attribute_context.h b/searchlib/src/vespa/searchlib/test/mock_attribute_context.h index 10e544617f0..140d71672fa 100644 --- a/searchlib/src/vespa/searchlib/test/mock_attribute_context.h +++ b/searchlib/src/vespa/searchlib/test/mock_attribute_context.h @@ -10,7 +10,7 @@ namespace search::attribute::test { class MockAttributeContext : public IAttributeContext { private: - typedef std::map<string, IAttributeVector *> Map; + using Map = std::map<string, IAttributeVector *>; Map _vectors; public: diff --git a/searchlib/src/vespa/searchlib/test/searchiteratorverifier.h b/searchlib/src/vespa/searchlib/test/searchiteratorverifier.h index 78fbd192bfa..4b80fc3e8b3 100644 --- a/searchlib/src/vespa/searchlib/test/searchiteratorverifier.h +++ b/searchlib/src/vespa/searchlib/test/searchiteratorverifier.h @@ -13,10 +13,10 @@ namespace search::test { class SearchIteratorVerifier { public: - typedef queryeval::SearchIterator SearchIterator; - typedef std::vector<uint32_t> DocIds; - typedef std::pair<uint32_t, uint32_t> Range; - typedef std::vector<Range> Ranges; + using SearchIterator = queryeval::SearchIterator; + using DocIds = std::vector<uint32_t>; + using Range = std::pair<uint32_t, uint32_t>; + using Ranges = std::vector<Range>; static SearchIterator::UP createIterator(const DocIds &docIds, bool strict); static SearchIterator::UP createEmptyIterator(); diff --git a/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp b/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp index edd53171510..0cb72202811 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp @@ -310,7 +310,7 @@ DomainPart::~DomainPart() void DomainPart::writeHeader(const FileHeaderContext &fileHeaderContext) { - typedef vespalib::GenericHeader::Tag Tag; + using Tag = vespalib::GenericHeader::Tag; FileHeader header; assert(_transLog->IsOpened()); assert(_transLog->IsWriteMode()); diff --git a/searchlib/src/vespa/searchlib/util/fileutil.h b/searchlib/src/vespa/searchlib/util/fileutil.h index 3ebb66c5b5e..e2f7e1a25c0 100644 --- a/searchlib/src/vespa/searchlib/util/fileutil.h +++ b/searchlib/src/vespa/searchlib/util/fileutil.h @@ -20,7 +20,7 @@ protected: public: LoadedBuffer(const LoadedBuffer & rhs) = delete; LoadedBuffer & operator =(const LoadedBuffer & rhs) = delete; - typedef std::unique_ptr<LoadedBuffer> UP; + using UP = std::unique_ptr<LoadedBuffer>; LoadedBuffer(void * buf, size_t sz) : _buffer(buf), @@ -95,7 +95,7 @@ template <typename T> class SequentialReadModifyWriteInterface { public: - typedef T Type; + using Type = T; virtual ~SequentialReadModifyWriteInterface() = default; virtual const T & read() = 0; virtual void write(const T & v) = 0; @@ -109,7 +109,7 @@ template <typename T> class SequentialReadModifyWriteVector : public SequentialReadModifyWriteInterface<T>, public vespalib::Array<T> { private: - typedef vespalib::Array<T> Vector; + using Vector = vespalib::Array<T>; public: SequentialReadModifyWriteVector(); explicit SequentialReadModifyWriteVector(size_t sz); diff --git a/searchlib/src/vespa/searchlib/util/posting_priority_queue.hpp b/searchlib/src/vespa/searchlib/util/posting_priority_queue.hpp index 33f3bce2be6..7f4733d8a70 100644 --- a/searchlib/src/vespa/searchlib/util/posting_priority_queue.hpp +++ b/searchlib/src/vespa/searchlib/util/posting_priority_queue.hpp @@ -10,7 +10,7 @@ template <class Reader> void PostingPriorityQueue<Reader>::adjust() { - typedef typename Vector::iterator VIT; + using VIT = typename Vector::iterator; if (!_vec.front().get()->isValid()) { _vec.erase(_vec.begin()); // Iterator no longer valid return; |