Skip to content

Commit

Permalink
Merge pull request #81 from edrosten/sh/update-io-upstream
Browse files Browse the repository at this point in the history
Update img_load to allow taking string parameters by const reference
  • Loading branch information
shanumante-sc authored Apr 1, 2022
2 parents 3868923 + 8bb35a6 commit a1d2b0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cvd/image_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Image<C> img_load(std::istream& i);
/// @param i The istream to load from
/// @ingroup gImageIO
template <class C>
Image<C> img_load(std::string& i);
Image<C> img_load(const std::string& i);

#endif

Expand Down Expand Up @@ -243,7 +243,7 @@ Internal::ImagePromise<Internal::ImageLoaderIstream<ImageTypes...>> img_load(std
}

template <class... ImageTypes>
Internal::ImagePromise<Internal::ImageLoaderString<ImageTypes...>> img_load(std::string& i)
Internal::ImagePromise<Internal::ImageLoaderString<ImageTypes...>> img_load(const std::string& i)
{
return i;
}
Expand All @@ -253,7 +253,7 @@ inline Internal::ImagePromise<Internal::ImageLoaderIstream<Internal::AllImageTyp
return i;
}

inline Internal::ImagePromise<Internal::ImageLoaderString<Internal::AllImageTypes>> img_load(std::string& i)
inline Internal::ImagePromise<Internal::ImageLoaderString<Internal::AllImageTypes>> img_load(const std::string& i)
{
return i;
}
Expand Down

0 comments on commit a1d2b0d

Please sign in to comment.