Skip to content

Commit 66d7050

Browse files
committed
another try
1 parent f1eefad commit 66d7050

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

include/shark/LinAlg/BLAS/detail/matrix_proxy_classes.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,13 @@ class linearized_matrix: public vector_expression<linearized_matrix<M>, typename
620620
row_major,
621621
typename M::orientation::orientation
622622
>::type orientation;
623+
624+
template<class IndexExpr>
625+
struct OperatorReturn{
626+
typedef decltype(device_traits<typename matrix_closure_type::device_type>::linearized_matrix_element(
627+
std::declval<matrix_closure_type const&>(),std::declval<IndexExpr const&>()
628+
)) type;
629+
};
623630
public:
624631
typedef typename M::value_type value_type;
625632
typedef typename M::const_reference const_reference;
@@ -662,10 +669,7 @@ class linearized_matrix: public vector_expression<linearized_matrix<M>, typename
662669

663670
// Element access
664671
template <class IndexExpr>
665-
auto operator()(IndexExpr const& i) const
666-
-> decltype(device_traits<typename M::device_type>::linearized_matrix_element(
667-
std::declval<matrix_closure_type const&>(),std::declval<IndexExpr const&>()
668-
)){
672+
typename OperatorReturn<IndexExpr>::type operator()(IndexExpr const& i) const{
669673
return device_traits<typename M::device_type>::linearized_matrix_element(m_expression,i);
670674
}
671675
reference operator [](size_type i) const{

0 commit comments

Comments
 (0)