diff --git a/src/OpenFOAM/containers/Lists/UList/UList.C b/src/OpenFOAM/containers/Lists/UList/UList.C index 413cec76e0068bc998e56312a052e359cc39b76a..ece482a0398b9f8da3f3a3ac20aac1b995f61983 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.C +++ b/src/OpenFOAM/containers/Lists/UList/UList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -48,29 +48,6 @@ Foam::labelRange Foam::UList<T>::validateRange(const labelRange& range) const } -template<class T> -Foam::labelRange Foam::UList<T>::validateRange -( - std::initializer_list<label> start_size -) const -{ - if (start_size.size() != 2) - { - FatalErrorInFunction - << "range specified with " << start_size.size() - << " elements instead of 2" - << abort(FatalError); - } - - auto iter = start_size.begin(); - - const label beg = *(iter++); - const label len = *iter; - - return this->validateRange(labelRange(beg, len)); -} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class T> @@ -176,31 +153,6 @@ const Foam::UList<T> Foam::UList<T>::operator[](const labelRange& range) const } -template<class T> -Foam::UList<T> Foam::UList<T>::operator[] -( - std::initializer_list<label> start_size -) -{ - const labelRange slice = validateRange(start_size); - - return UList<T>(&(this->v_[slice.start()]), slice.size()); // SubList -} - - -template<class T> -const Foam::UList<T> Foam::UList<T>::operator[] -( - std::initializer_list<label> start_size -) const -{ - // Restricted range - const labelRange slice = validateRange(start_size); - - return UList<T>(&(this->v_[slice.start()]), slice.size()); // SubList -} - - template<class T> void Foam::UList<T>::operator=(const T& val) { diff --git a/src/OpenFOAM/containers/Lists/UList/UList.H b/src/OpenFOAM/containers/Lists/UList/UList.H index 0aa8492bd28577366534779cd092466468789d07..7ea917510bf057ccbf8f423fe45d27a47e539c52 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.H +++ b/src/OpenFOAM/containers/Lists/UList/UList.H @@ -123,12 +123,6 @@ protected: //- always addresses a valid section of the list. labelRange validateRange(const labelRange& range) const; - //- Return a validated (start,size) subset range, which means that it - //- always addresses a valid section of the list. - labelRange validateRange - ( - std::initializer_list<label> start_size_pair - ) const; public: @@ -361,19 +355,6 @@ public: // result always addresses a valid section of the list. const UList<T> operator[](const labelRange& range) const; - //- Return (start,size) subset from UList with non-const access. - // The range is subsetted with the list size itself to ensure that the - // result always addresses a valid section of the list. - UList<T> operator[](std::initializer_list<label> start_size); - - //- Return (start,size) subset from UList with const access. - // The range is subsetted with the list size itself to ensure that the - // result always addresses a valid section of the list. - const UList<T> operator[] - ( - std::initializer_list<label> start_size - ) const; - //- Allow cast to a const List<T>& inline operator const Foam::List<T>&() const;