Commit e35ecae8 by Junru Shao Committed by Tianqi Chen

Allow Array/Map store objects that are not NodeRef (#4430)

parent bc69a534
...@@ -137,7 +137,7 @@ class IterAdapter { ...@@ -137,7 +137,7 @@ class IterAdapter {
* \tparam T The content NodeRef type. * \tparam T The content NodeRef type.
*/ */
template<typename T, template<typename T,
typename = typename std::enable_if<std::is_base_of<NodeRef, T>::value>::type > typename = typename std::enable_if<std::is_base_of<ObjectRef, T>::value>::type >
class Array : public NodeRef { class Array : public NodeRef {
public: public:
/*! /*!
...@@ -330,9 +330,9 @@ class Array : public NodeRef { ...@@ -330,9 +330,9 @@ class Array : public NodeRef {
template<typename K, template<typename K,
typename V, typename V,
typename = typename std::enable_if< typename = typename std::enable_if<
std::is_base_of<NodeRef, K>::value || std::is_base_of<ObjectRef, K>::value ||
std::is_base_of<std::string, K>::value >::type, std::is_base_of<std::string, K>::value >::type,
typename = typename std::enable_if<std::is_base_of<NodeRef, V>::value>::type> typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type>
class Map : public NodeRef { class Map : public NodeRef {
public: public:
/*! /*!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment