Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/xtensor/containers/xscalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ namespace xt
using accessible_base::shape;

template <class... Args>
reference operator()(Args...) noexcept;
reference operator()(Args...);
template <class... Args>
reference unchecked(Args...) noexcept;

template <class... Args>
const_reference operator()(Args...) const noexcept;
const_reference operator()(Args...) const;
template <class... Args>
const_reference unchecked(Args...) const noexcept;

Expand Down Expand Up @@ -551,7 +551,7 @@ namespace xt

template <class CT>
template <class... Args>
inline auto xscalar<CT>::operator()(Args...) noexcept -> reference
inline auto xscalar<CT>::operator()(Args...) -> reference
{
XTENSOR_CHECK_DIMENSION((std::array<int, 0>()), Args()...);
return m_value;
Expand All @@ -566,7 +566,7 @@ namespace xt

template <class CT>
template <class... Args>
inline auto xscalar<CT>::operator()(Args...) const noexcept -> const_reference
inline auto xscalar<CT>::operator()(Args...) const -> const_reference
{
XTENSOR_CHECK_DIMENSION((std::array<int, 0>()), Args()...);
return m_value;
Expand Down
4 changes: 2 additions & 2 deletions include/xtensor/core/xaccessible.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace xt
using size_type = typename inner_types::size_type;

size_type size() const noexcept(noexcept(derived_cast().shape()));
size_type dimension() const noexcept;
size_type dimension() const noexcept(noexcept(derived_cast().shape()));
size_type shape(size_type index) const;

template <class... Args>
Expand Down Expand Up @@ -147,7 +147,7 @@ namespace xt
* Returns the number of dimensions of the expression.
*/
template <class D>
inline auto xconst_accessible<D>::dimension() const noexcept -> size_type
inline auto xconst_accessible<D>::dimension() const noexcept(noexcept(derived_cast().shape())) -> size_type
{
return derived_cast().shape().size();
}
Expand Down
46 changes: 25 additions & 21 deletions include/xtensor/core/xexpression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,29 +424,33 @@ namespace xt
return m_ptr->name(); \
}

#define XTENSOR_FORWARD_CONST_ITERATOR_METHOD(name) \
template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL> \
auto name() const noexcept -> decltype(std::declval<xtl::constify_t<E>>().template name<L>()) \
{ \
return m_ptr->template name<L>(); \
} \
template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL, class S> \
auto name(const S& shape) const noexcept \
-> decltype(std::declval<xtl::constify_t<E>>().template name<L>(shape)) \
{ \
return m_ptr->template name<L>(); \
#define XTENSOR_FORWARD_CONST_ITERATOR_METHOD(name) \
template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL> \
auto name() const noexcept(noexcept(std::declval<xtl::constify_t<E>>().template name<L>())) \
-> decltype(std::declval<xtl::constify_t<E>>().template name<L>()) \
{ \
return m_ptr->template name<L>(); \
} \
template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL, class S> \
auto name(const S& shape) \
const noexcept(noexcept(std::declval<xtl::constify_t<E>>().template name<L>(shape))) \
-> decltype(std::declval<xtl::constify_t<E>>().template name<L>(shape)) \
{ \
return m_ptr->template name<L>(); \
}

#define XTENSOR_FORWARD_ITERATOR_METHOD(name) \
template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL, class S> \
auto name(const S& shape) noexcept -> decltype(std::declval<E>().template name<L>(shape)) \
{ \
return m_ptr->template name<L>(); \
} \
template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL> \
auto name() noexcept -> decltype(std::declval<E>().template name<L>()) \
{ \
return m_ptr->template name<L>(); \
#define XTENSOR_FORWARD_ITERATOR_METHOD(name) \
template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL, class S> \
auto name(const S& shape) noexcept(noexcept(std::declval<E>().template name<L>(shape))) \
-> decltype(std::declval<E>().template name<L>(shape)) \
{ \
return m_ptr->template name<L>(); \
} \
template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL> \
auto name() noexcept(noexcept(std::declval<E>().template name<L>())) \
-> decltype(std::declval<E>().template name<L>()) \
{ \
return m_ptr->template name<L>(); \
}

namespace detail
Expand Down
18 changes: 12 additions & 6 deletions include/xtensor/core/xfunction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ namespace xt
bool is_trivial;
bool is_initialized;

xfunction_cache_impl()
: shape(xtl::make_sequence<S>(0, std::size_t(0)))
xfunction_cache_impl() noexcept
: shape()
, is_trivial(false)
, is_initialized(false)
{
Expand Down Expand Up @@ -272,10 +272,13 @@ namespace xt
using const_reverse_iterator = typename iterable_base::const_reverse_iterator;

template <class Func, class... CTA, class U = std::enable_if_t<!std::is_base_of<std::decay_t<Func>, self_type>::value>>
xfunction(Func&& f, CTA&&... e) noexcept;
xfunction(Func&& f, CTA&&... e) noexcept(
std::is_nothrow_constructible<tuple_type, CTA&&...>::value
&& std::is_nothrow_constructible<functor_type, Func&&>::value
);

template <class FA, class... CTA>
xfunction(xfunction<FA, CTA...> xf) noexcept;
xfunction(xfunction<FA, CTA...> xf);

~xfunction() = default;

Expand Down Expand Up @@ -498,7 +501,10 @@ namespace xt
*/
template <class F, class... CT>
template <class Func, class... CTA, class U>
inline xfunction<F, CT...>::xfunction(Func&& f, CTA&&... e) noexcept
inline xfunction<F, CT...>::xfunction(Func&& f, CTA&&... e) noexcept(
std::is_nothrow_constructible<tuple_type, CTA&&...>::value
&& std::is_nothrow_constructible<functor_type, Func&&>::value
)
: m_e(std::forward<CTA>(e)...)
, m_f(std::forward<Func>(f))
{
Expand All @@ -511,7 +517,7 @@ namespace xt
*/
template <class F, class... CT>
template <class FA, class... CTA>
inline xfunction<F, CT...>::xfunction(xfunction<FA, CTA...> xf) noexcept
inline xfunction<F, CT...>::xfunction(xfunction<FA, CTA...> xf)
: m_e(xf.arguments())
, m_f(xf.functor())
{
Expand Down
Loading
Loading