1#ifndef KNNCOLLE_ANNOY_UTILS_HPP
2#define KNNCOLLE_ANNOY_UTILS_HPP
23template<
typename Input_>
24using I = std::remove_cv_t<std::remove_reference_t<Input_> >;
27template<
typename AnnoyDistance_,
typename Other_ =
int>
29 static constexpr bool value =
false;
32template<
typename AnnoyDistance_>
33struct has_name<AnnoyDistance_, decltype(AnnoyDistance_::name(), 0)> {
34 static constexpr bool value = std::is_same<
decltype(AnnoyDistance_::name()),
const char*>::value;
47template<
typename AnnoyDistance_>
49 if constexpr(!has_name<AnnoyDistance_>::value) {
52 return AnnoyDistance_::name();
71template<
class AnnoyIndex_>
73 static std::function<void(
const std::filesystem::path&)> fun;
92template<
class AnnoyData_>
94 static std::function<void(
const std::filesystem::path&)> fun;
113template<
class AnnoyDistance_>
115 static std::function<void(
const std::filesystem::path&)> fun;
Approximate nearest neighbor search with Annoy.
Definition Annoy.hpp:24
const char * get_distance_name()
Definition utils.hpp:48
std::function< void(const std::filesystem::path &)> & custom_save_for_annoy_index()
Definition utils.hpp:72
std::function< void(const std::filesystem::path &)> & custom_save_for_annoy_data()
Definition utils.hpp:93
std::function< void(const std::filesystem::path &)> & custom_save_for_annoy_distance()
Definition utils.hpp:114