Skip to content

Commit

Permalink
Made conversion operator explicit.
Browse files Browse the repository at this point in the history
const and non-const get() functions return a reference.
  • Loading branch information
jwellbelove committed Jan 20, 2017
1 parent 9848bba commit 6dcd00a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/type_def.h
Expand Up @@ -41,7 +41,7 @@ namespace etl
///\code
/// // Short form.
/// ETL_TYPEDEF(int, mytype);
///
///
/// // Long form.
/// class mytype_t_tag;
/// typedef etl::type_def<mytype_t_tag, int> mytype_t_tag;
Expand Down Expand Up @@ -74,7 +74,7 @@ namespace etl
}

//*********************************************************************
operator TValue() const
explicit operator TValue() const
{
return value;
}
Expand Down Expand Up @@ -243,7 +243,13 @@ namespace etl
}

//*********************************************************************
TValue get() const
TValue& get()
{
return value;
}

//*********************************************************************
const TValue& get() const
{
return value;
}
Expand Down

0 comments on commit 6dcd00a

Please sign in to comment.