Skip to content

Commit

Permalink
Remove const for Point1::new when targetting cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcrozet committed Sep 24, 2022
1 parent 1079f0c commit 1870080
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/geometry/point_construction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,29 @@ impl<T: Scalar> Point1<T> {
/// assert_eq!(p.x, 1.0);
/// ```
#[inline]
#[cfg(not(feature = "cuda"))]
pub const fn new(x: T) -> Self {
Point {
coords: Vector1::new(x),
}
}

/// Initializes this point from its components.
///
/// # Example
///
/// ```
/// # use nalgebra::Point1;
/// let p = Point1::new(1.0);
/// assert_eq!(p.x, 1.0);
/// ```
#[inline]
#[cfg(feature = "cuda")]
pub fn new(x: T) -> Self {
Point {
coords: Vector1::new(x),
}
}
}
macro_rules! componentwise_constructors_impl(
($($doc: expr; $Point: ident, $Vector: ident, $($args: ident:$irow: expr),*);* $(;)*) => {$(
Expand Down

0 comments on commit 1870080

Please sign in to comment.