Allow the single-arg Values() overload to to conversions, just like every other
overload.
This commit is contained in:
parent
7d7beaa155
commit
9e38d77f65
|
@ -79,7 +79,10 @@ class ValueArray1 {
|
||||||
explicit ValueArray1(T1 v1) : v1_(v1) {}
|
explicit ValueArray1(T1 v1) : v1_(v1) {}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
|
operator ParamGenerator<T>() const {
|
||||||
|
const T array[] = {static_cast<T>(v1_)};
|
||||||
|
return ValuesIn(array);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// No implementation - assignment is unsupported.
|
// No implementation - assignment is unsupported.
|
||||||
|
|
|
@ -72,29 +72,14 @@ internal::ParamGenerator<typename Container::value_type> ValuesIn(
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
// Used in the Values() function to provide polymorphic capabilities.
|
// Used in the Values() function to provide polymorphic capabilities.
|
||||||
template <typename T1>
|
$range i 1..n
|
||||||
class ValueArray1 {
|
|
||||||
public:
|
|
||||||
explicit ValueArray1(T1 v1) : v1_(v1) {}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
// No implementation - assignment is unsupported.
|
|
||||||
void operator=(const ValueArray1& other);
|
|
||||||
|
|
||||||
const T1 v1_;
|
|
||||||
};
|
|
||||||
|
|
||||||
$range i 2..n
|
|
||||||
$for i [[
|
$for i [[
|
||||||
$range j 1..i
|
$range j 1..i
|
||||||
|
|
||||||
template <$for j, [[typename T$j]]>
|
template <$for j, [[typename T$j]]>
|
||||||
class ValueArray$i {
|
class ValueArray$i {
|
||||||
public:
|
public:
|
||||||
ValueArray$i($for j, [[T$j v$j]]) : $for j, [[v$(j)_(v$j)]] {}
|
$if i==1 [[explicit ]]ValueArray$i($for j, [[T$j v$j]]) : $for j, [[v$(j)_(v$j)]] {}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
operator ParamGenerator<T>() const {
|
operator ParamGenerator<T>() const {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user