Add a non-const version of Point::new when the cuda feature is enabled

This commit is contained in:
Sébastien Crozet 2022-09-24 09:50:58 +02:00
parent 7adecdef6c
commit 1079f0c1c3
1 changed files with 13 additions and 0 deletions

View File

@ -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),*) }
}
}
)*}
);