File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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-
238227public:
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.
You can’t perform that action at this time.
0 commit comments