Skip to content

Commit

Permalink
Add a non-const version of Point::new when the cuda feature is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcrozet committed Sep 24, 2022
1 parent 7adecde commit 1079f0c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/geometry/point_construction.rs
Expand Up @@ -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),*) }
}
}
)*}
);
Expand Down

0 comments on commit 1079f0c

Please sign in to comment.