From 6e5f488f7190f308f7a8efe5b035d82675b721bb Mon Sep 17 00:00:00 2001 From: Heiko Strathmann Date: Tue, 23 Jan 2018 14:09:37 +0000 Subject: [PATCH] Change make_any_ref_array to make_any_ref Use overloading rather than new names --- src/shogun/base/SGObject.h | 2 +- src/shogun/lib/any.h | 2 +- tests/unit/lib/Any_unittest.cc | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shogun/base/SGObject.h b/src/shogun/base/SGObject.h index 2f68b0e51f6..6595db035c0 100644 --- a/src/shogun/base/SGObject.h +++ b/src/shogun/base/SGObject.h @@ -523,7 +523,7 @@ class CSGObject { BaseTag tag(name); create_parameter( - tag, AnyParameter(make_any_ref_array(value, len), properties)); + tag, AnyParameter(make_any_ref(value, len), properties)); } public: diff --git a/src/shogun/lib/any.h b/src/shogun/lib/any.h index fc1ea6a3db1..97989cc1404 100644 --- a/src/shogun/lib/any.h +++ b/src/shogun/lib/any.h @@ -799,7 +799,7 @@ namespace shogun } template - inline Any make_any_ref_array(T** ptr, S* length) + inline Any make_any_ref(T** ptr, S* length) { return make_any(ArrayReference(ptr, length)); } diff --git a/tests/unit/lib/Any_unittest.cc b/tests/unit/lib/Any_unittest.cc index 320c42cd5be..ed8328310bc 100644 --- a/tests/unit/lib/Any_unittest.cc +++ b/tests/unit/lib/Any_unittest.cc @@ -391,9 +391,9 @@ TEST(Any, array_ref) float* other = new float[other_len]; std::iota(other, other + other_len, 9); - auto any_src = make_any_ref_array(&src, &src_len); - auto any_dst = make_any_ref_array(&dst, &dst_len); - auto any_other = make_any_ref_array(&other, &other_len); + auto any_src = make_any_ref(&src, &src_len); + auto any_dst = make_any_ref(&dst, &dst_len); + auto any_other = make_any_ref(&other, &other_len); EXPECT_EQ(any_src, any_src); EXPECT_EQ(any_dst, any_dst);