Skip to content

Commit

Permalink
Add inlines in xnpy.hpp to remove dupe symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
OneRaynyDay authored and wolfv committed Aug 22, 2018
1 parent 4d2c73f commit bb1ce3a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/xtensor/xnpy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ namespace xt
}

template <class T>
constexpr inline char get_endianess()
constexpr char get_endianess()
{
return sizeof(T) <= sizeof(char) ? no_endian_char : host_endian_char;
}

template <class T>
std::string build_typestring()
inline std::string build_typestring()
{
std::stringstream ss;
ss << get_endianess<T>() << map_type<T>() << sizeof(T);
Expand Down Expand Up @@ -599,7 +599,7 @@ namespace xt
char* m_buffer;
};

npy_file load_npy_file(std::istream& stream)
inline npy_file load_npy_file(std::istream& stream)
{
// check magic bytes an version number
unsigned char v_major, v_minor;
Expand Down Expand Up @@ -634,7 +634,7 @@ namespace xt
}

template <class O, class E>
void dump_npy_stream(O& stream, const xexpression<E>& e)
inline void dump_npy_stream(O& stream, const xexpression<E>& e)
{
using value_type = typename E::value_type;
const E& ex = e.derived_cast();
Expand Down Expand Up @@ -664,7 +664,7 @@ namespace xt
* @param e the xexpression
*/
template <typename E>
void dump_npy(const std::string& filename, const xexpression<E>& e)
inline void dump_npy(const std::string& filename, const xexpression<E>& e)
{
std::ofstream stream(filename, std::ofstream::binary);
if (!stream)
Expand All @@ -686,7 +686,7 @@ namespace xt
* @return xarray with contents from npy file
*/
template <typename T, layout_type L = layout_type::dynamic>
auto load_npy(const std::string& filename)
inline auto load_npy(const std::string& filename)
{
std::ifstream stream(filename, std::ifstream::binary);
if (!stream)
Expand Down

0 comments on commit bb1ce3a

Please sign in to comment.