This commit is contained in:
Timur A. Fatkhullin
2025-09-02 00:45:23 +03:00
parent 3d3b57a311
commit de80acf315
7 changed files with 390 additions and 80 deletions

View File

@@ -157,9 +157,10 @@ concept mcc_julday_c = mcc_fp_type_like_c<T> && requires(const T v) {
/* ERROR CLASS CONCEPT */
template <typename T>
concept mcc_error_c = std::convertible_to<T, bool> || requires(const T t) {
{ t.operator bool() };
};
concept mcc_error_c = std::default_initializable<T> && (std::convertible_to<T, bool> || requires(const T t) {
{ t.operator bool() };
(bool)T() == false; // default constucted value must be a "non-error"!
});
template <mcc_error_c ErrT, typename DErrT>
@@ -716,13 +717,21 @@ struct mcc_pzone_interface_t {
// NOTE: the method must return:
// point = mcc_celestial_point_c{.pair_kind = MccCoordPairKind::COORDS_KIND_GENERIC, .X = NaN, .Y = NaN}
// if there is no intersection with the zone for given coordinates!
template <std::derived_from<mcc_pzone_interface_t> SelfT, typename InputT>
RetT intersectPZone(this SelfT&& self, InputT coords, mcc_celestial_point_c auto* point)
requires(mcc_eqt_hrz_coord_c<InputT> || mcc_celestial_point_c<InputT>) &&
template <std::derived_from<mcc_pzone_interface_t> SelfT, typename InputT, typename ResultT>
RetT intersectPZone(this SelfT&& self, InputT coords, ResultT* point)
requires((mcc_eqt_hrz_coord_c<InputT> || mcc_celestial_point_c<InputT>) &&
(mcc_eqt_hrz_coord_c<ResultT> || mcc_celestial_point_c<ResultT>)) &&
requires { self.intersectPZone(coords, point); }
{
return std::forward<SelfT>(self).intersectPZone(std::move(coords), point);
}
// template <std::derived_from<mcc_pzone_interface_t> SelfT, typename InputT>
// RetT intersectPZone(this SelfT&& self, InputT coords, mcc_celestial_point_c auto* point)
// requires(mcc_eqt_hrz_coord_c<InputT> || mcc_celestial_point_c<InputT>) &&
// requires { self.intersectPZone(coords, point); }
// {
// return std::forward<SelfT>(self).intersectPZone(std::move(coords), point);
// }
protected:
mcc_pzone_interface_t() = default;
@@ -788,9 +797,17 @@ struct mcc_pzone_container_interface_t {
}
template <std::derived_from<mcc_pzone_container_interface_t> SelfT, typename InputT, mcc_celestial_point_c CPT>
RetT intersectPZone(this SelfT&& self, InputT coords, std::ranges::output_range<CPT> auto* result)
requires(mcc_eqt_hrz_coord_c<InputT> || mcc_celestial_point_c<InputT>)
// template <std::derived_from<mcc_pzone_container_interface_t> SelfT, typename InputT, mcc_celestial_point_c CPT>
// RetT intersectPZone(this SelfT&& self, InputT coords, std::ranges::output_range<CPT> auto* result)
// requires(mcc_eqt_hrz_coord_c<InputT> || mcc_celestial_point_c<InputT>)
// {
// return std::forward<SelfT>(self).intersectPZone(std::move(coords), result);
// }
template <std::derived_from<mcc_pzone_container_interface_t> SelfT, typename InputT, typename ResultT>
RetT intersectPZone(this SelfT&& self, InputT coords, std::ranges::output_range<ResultT> auto* result)
requires((mcc_eqt_hrz_coord_c<InputT> || mcc_celestial_point_c<InputT>) &&
(mcc_eqt_hrz_coord_c<ResultT> || mcc_celestial_point_c<ResultT>))
{
return std::forward<SelfT>(self).intersectPZone(std::move(coords), result);
}