Sirius  0.0.0
gsl.h
Go to the documentation of this file.
1 
22 #ifndef SIRIUS_UTILS_GSL_H_
23 #define SIRIUS_UTILS_GSL_H_
24 
25 #include <gsl/gsl>
26 
27 namespace sirius {
28 namespace utils {
29 
36 template <typename SmartPtr>
37 auto MakeSmartPtrArraySpan(const SmartPtr& smart_ptr, const Size& size) {
38  return gsl::span<typename SmartPtr::element_type>(smart_ptr.get(),
39  size.CellCount());
40 }
41 
42 } // namespace utils
43 } // namespace sirius
44 
45 #endif // SIRIUS_UTILS_GSL_H_
Definition: exception.h:27
auto MakeSmartPtrArraySpan(const SmartPtr &smart_ptr, const Size &size)
Make a GSL span from a smart pointer pointing to an array of data.
Definition: gsl.h:37
int CellCount() const
Definition: types.h:77
Data class that represents the size of an image.
Definition: types.h:38