From 3d26976c3bdd12e7e1938365051e0924a4486f8c Mon Sep 17 00:00:00 2001 From: Jihoon Lee Date: Wed, 16 Jun 2021 17:41:46 +0900 Subject: [PATCH] [Layer] Add const to the layer::getName() getName() is independent of const, so this patch adds const to layer::getName(); **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: Jihoon Lee --- api/ccapi/include/layer.h | 2 +- nntrainer/graph/graph_node.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/ccapi/include/layer.h b/api/ccapi/include/layer.h index f0c87c1..d5332dd 100644 --- a/api/ccapi/include/layer.h +++ b/api/ccapi/include/layer.h @@ -134,7 +134,7 @@ public: * @note This name might be changed once this layer is added to the model * to keep the name unique to the model */ - virtual std::string getName() noexcept = 0; + virtual const std::string getName() const noexcept = 0; }; /** diff --git a/nntrainer/graph/graph_node.h b/nntrainer/graph/graph_node.h index e687516..47acacc 100644 --- a/nntrainer/graph/graph_node.h +++ b/nntrainer/graph/graph_node.h @@ -49,7 +49,7 @@ public: * @return std::string Name of the underlying object * @note name of each node in the graph must be unique */ - virtual std::string getName() noexcept = 0; + virtual const std::string getName() const noexcept = 0; /** * @brief Set the Name of the underlying object -- 2.7.4