#[const_fn]
An attribute for easy generation of a const function with conditional compilations.
Usage
Add this to your Cargo.toml
:
[]
= "0.1"
and this to your crate root:
extern crate const_fn;
Examples
When using like the following functions to control unstable features:
[]
= []
It can be written as follows:
pub const
Code like this will be generated:
pub const
See test_suite for more examples.
Rust Version
The current minimum required Rust version is 1.30.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.