Skip to content

Commit fbb2fa3

Browse files
committed
remove std::initializer_list constructor from vector
1 parent 96af05b commit fbb2fa3

1 file changed

Lines changed: 1 addition & 37 deletions

File tree

src/r4/vector.hpp

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -218,49 +218,13 @@ class vector :
218218
std::enable_if_t<
219219
sizeof...(arguments_type) == dimension, //
220220
bool> = true>
221-
constexpr explicit vector(arguments_type... v) noexcept :
221+
constexpr vector(arguments_type... v) noexcept :
222222
base_type{component_type(v)...}
223223
{
224224
static_assert(sizeof...(v) == dimension, "number of constructor arguments is not equal to vector size");
225225
}
226226

227-
private:
228-
template <size_t... indices>
229-
constexpr vector(
230-
std::initializer_list<component_type> vals, //
231-
std::index_sequence<indices...>
232-
)
233-
// NOTE: cannot make it noexcept because std::next() is not noexcept
234-
:
235-
base_type{*std::next(std::cbegin(vals), indices)...}
236-
{}
237-
238227
public:
239-
/**
240-
* @brief Construct initialized vector.
241-
* Creates a vector and initializes its components by the given values.
242-
* @param vals - initializer list of numbers to set as components of the vector.
243-
*/
244-
constexpr vector(std::initializer_list<component_type> vals) :
245-
vector(
246-
[&vals]() {
247-
if (vals.size() == dimension) {
248-
return vals;
249-
}
250-
utki::assert(
251-
false,
252-
[&](auto& o) {
253-
o << "wrong number of elements in initializer list of vector(std::initializer_list), expected "
254-
<< dimension << ", got " << vals.size() << std::endl;
255-
},
256-
SL
257-
);
258-
return std::initializer_list<component_type>();
259-
}(),
260-
std::make_index_sequence<dimension>()
261-
)
262-
{}
263-
264228
/**
265229
* @brief Constructor.
266230
* Initializes all vector components to a given value.

0 commit comments

Comments
 (0)