From 1079f0c1c395f9c1d8f7a66eaff979f64ac4bed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 24 Sep 2022 09:50:58 +0200 Subject: [PATCH] Add a non-const version of Point::new when the cuda feature is enabled --- src/geometry/point_construction.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/geometry/point_construction.rs b/src/geometry/point_construction.rs index ac54b349..c061b872 100644 --- a/src/geometry/point_construction.rs +++ b/src/geometry/point_construction.rs @@ -216,9 +216,22 @@ macro_rules! componentwise_constructors_impl( #[doc = $doc] #[doc = "```"] #[inline] + #[cfg(not(feature = "cuda"))] pub const fn new($($args: T),*) -> Self { Point { coords: $Vector::new($($args),*) } } + + // TODO: always let new be const once CUDA updates its supported + // nightly version to something more recent. + #[doc = "Initializes this point from its components."] + #[doc = "# Example\n```"] + #[doc = $doc] + #[doc = "```"] + #[inline] + #[cfg(feature = "cuda")] + pub fn new($($args: T),*) -> Self { + Point { coords: $Vector::new($($args),*) } + } } )*} );