From b6539a2639d86bb18cffe7383a9b0a25ede6a71f Mon Sep 17 00:00:00 2001 From: Ka Ho Ng Date: Fri, 19 Jan 2018 23:45:53 +0800 Subject: [PATCH] Add INVALID_ID as a constant for Id class Template This is for identifying invalid ID from normal ID. --- src/indexer.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/indexer.h b/src/indexer.h index 93f4e5ec..04315002 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -35,6 +35,8 @@ template struct Id { size_t id; + static constexpr size_t INVALID_ID = static_cast(-1); + Id() : id(0) {} // Needed for containers. Do not use directly. explicit Id(size_t id) : id(id) {}