Closed burrbull closed 5 years ago
You can use emit_rustc_version
in the build script to get a cfg
flag. The entire fn
would have to be duplicated with and without the const
qualifier.
However, do we really need const fn new
? The fields are public, so Complex { re, im }
should work just fine in constant expressions. (I suppose that could also argue against having new
at all...)
I added conditional const functions in https://github.com/rust-num/num-rational/pull/48, if that helps you here.
Does not work:
error[E0592]: duplicate definitions with name `new`
Accidentally close PR.
Sorry. All fine.
Created new #63
Is it possible to specify rust version feature gate?