view: remove noexcept from redim

redim can throw, it shouldn't be noexcept...
This commit is contained in:
Danny Robson 2017-08-31 13:48:44 +10:00
parent 0e97044adf
commit acfbec871a

View File

@ -11,13 +11,14 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
* Copyright 2015-2016 Danny Robson <danny@nerdcruft.net> * Copyright 2015-2017 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_VIEW_HPP #ifndef CRUFT_UTIL_VIEW_HPP
#define __UTIL_VIEW_HPP #define CRUFT_UTIL_VIEW_HPP
#include "./debug.hpp"
#include "./types/traits.hpp" #include "./types/traits.hpp"
#include <cstdlib> #include <cstdlib>
@ -77,8 +78,9 @@ namespace util {
} }
constexpr auto constexpr auto
redim (int count) const noexcept redim (int count) const
{ {
CHECK_GT (count, 0);
if (count > size ()) if (count > size ())
throw std::invalid_argument ("redim to higher size not allowed"); throw std::invalid_argument ("redim to higher size not allowed");
return view { m_begin, m_begin + count }; return view { m_begin, m_begin + count };