Skip to content

Commit

Permalink
Make all single-argument StatisticInstance constructors explicit
Browse files Browse the repository at this point in the history
Change StatAdder operator() to take const TreeNode* instead of TreeNode*
  • Loading branch information
bdutro committed May 2, 2024
1 parent c4d456b commit 6944bdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sparta/sparta/report/Report.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ namespace sparta
r_.add(ctr, name);
return *this;
}
StatAdder& operator()(TreeNode* n,
StatAdder& operator()(const TreeNode* n,
const std::string& name="") {
r_.add(n, name);
return *this;
Expand Down
8 changes: 4 additions & 4 deletions sparta/sparta/statistics/StatisticInstance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace sparta
* \note Stream insertion operator can be used to add more text to the
* reason.
*/
ReversedStatisticRange(const std::string & reason) :
explicit ReversedStatisticRange(const std::string & reason) :
SpartaException(reason)
{ }

Expand All @@ -67,7 +67,7 @@ namespace sparta
* \note Stream insertion operator can be used to add more text to the
* reason.
*/
FutureStatisticRange(const std::string & reason) :
explicit FutureStatisticRange(const std::string & reason) :
SpartaException(reason)
{ }

Expand Down Expand Up @@ -128,15 +128,15 @@ namespace sparta
* \note You *must* set the context (setContext) after this
* call. The Expression might or might not know the context for the Scheduler
*/
StatisticInstance(statistics::expression::Expression&& expr) :
explicit StatisticInstance(statistics::expression::Expression&& expr) :
stat_expr_(expr)
{ }

/*!
* \brief Construct with a StatisticDef or Counter as a TreeNode*
* \param node Must be an interface to a StatisticDef or a Counter
*/
StatisticInstance(const TreeNode* node) :
explicit StatisticInstance(const TreeNode* node) :
StatisticInstance(nullptr, nullptr, nullptr, node, nullptr)
{ }

Expand Down

0 comments on commit 6944bdb

Please sign in to comment.