Skip to content

Commit

Permalink
don't allow for pointer inside Some<> and use enable_if_t
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnapf committed Feb 18, 2018
1 parent 8f03a9d commit f7cc757
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shogun/base/SGObject.h
Expand Up @@ -403,7 +403,7 @@ class CSGObject
* @param name name of the parameter
* @param value value of the parameter, wrapped in smart pointer
*/
template <typename T, typename T2 = typename std::enable_if<std::is_base_of<CSGObject, typename std::remove_pointer<T>::type>::value, T>::type>
template <typename T, typename std::enable_if_t<std::is_base_of<CSGObject, T>::value, T>* = nullptr>

This comment has been minimized.

Copy link
@vigsterkr

vigsterkr Feb 19, 2018

Member

you could actually drop the second typename but it's just a small detail

This comment has been minimized.

Copy link
@thaeazyway100

thaeazyway100 Feb 19, 2018

Enable

This comment has been minimized.

Copy link
@vigsterkr

vigsterkr Feb 19, 2018

Member

This comment has been minimized.

Copy link
@thaeazyway100

thaeazyway100 Feb 19, 2018

Disable

This comment has been minimized.

Copy link
@karlnapf

karlnapf Feb 19, 2018

Author Member

💃

void put(const std::string& name, Some<T> value)
{
put(name, (CSGObject*)(value.get()));
Expand Down

0 comments on commit f7cc757

Please sign in to comment.