diff --git a/src/xtd.core/include/xtd/collections/generic/params.h b/src/xtd.core/include/xtd/collections/generic/params.h index f9d0748938f..df8d8be4000 100644 --- a/src/xtd.core/include/xtd/collections/generic/params.h +++ b/src/xtd.core/include/xtd/collections/generic/params.h @@ -68,10 +68,8 @@ namespace xtd { /// @} /// @cond - params(const params&) noexcept = default; - params(params&&) noexcept = default; - params(const base_type& il) noexcept : items_(il) {} - params(base_type&& il) noexcept : items_(il) {} + params(base_type items) noexcept : items_(items) {} + params& operator =(base_type items) noexcept {items_ = items; return *this;} /// @endcond /// @name Public Properties @@ -81,21 +79,21 @@ namespace xtd { /// @return A pointer to the first element in the params. /// @remarks If the params is empty, the values of begin() and end() are unspecified, but will be identical. constexpr iterator begin() const noexcept {return items_.begin();} - + /// @brief Returns pointer to the underlying array serving as element storage. /// @return Pointer to the underlying element storage. For non-empty containers, the returned pointer compares equal to the address of the first element. /// @remarks The pointer is such that range [xtd::collections::generic::list::data(), xtd::collections::generic::list::data() + xtd::collections::generic::list::size()) is always a valid range, even if the container is empty (xtd::collections::generic::list::data() is not dereferenceable in that case). - virtual const_pointer data() const noexcept {return reinterpret_cast(begin());} - + const_pointer data() const noexcept {return reinterpret_cast(begin());} + /// @brief Returns a pointer to one past the last element in the params, i.e. begin() + size(). /// @return A pointer to one past the last element in the params. /// @remarks If the params is empty, the values of begin() and end() are unspecified, but will be identical. constexpr iterator end() const noexcept {return items_.end();} - + /// @brief Returns the underlying base type items. /// @return The underlying base type items. - virtual const base_type& items() const noexcept {return items_;} - + const base_type& items() const noexcept {return items_;} + /// @brief Returns the number of elements in the params, i.e. `std::distance(begin(), end())`. /// @return The number of elements in the params. constexpr size_type size() const noexcept {return items_.size();} @@ -113,14 +111,19 @@ namespace xtd { /// @brief Returns a reference to the underlying base type. /// @return Reference to the underlying base type. operator const base_type&() const noexcept {return items_;} - /// @brief Returns a reference to the underlying base type. - /// @return Reference to the underlying base type. - operator base_type&() noexcept {return items_;} /// @} private: base_type items_; }; + + /// @cond + // C++17 deduction + // { + template + params(std::initializer_list) -> params; + // } + /// @endcond } } }