Compile-time expressions (constexpr) are a C++11 feature that allows constants of any type to be used in contexts that previously required integers. Since this is a fully backward-compatible extension of a class's functionality, Effective Modern C++ recommends using constexpr anywhere where language rules and future implementation changes allow it.
Retrofitting constexpr to all classes in afw is impractical, but constexpr support is most valuable for classes that represent simple data types (e.g., Angle or Point). This ticket therefore covers a subset of the following types, whose appropriateness will be determined when work begins:
- afw::cameraGeom::CameraPoint
- afw::cameraGeom::CameraSys
- afw::cameraGeom::CameraSysPrefix
- afw::cameraGeom::Orientation
- afw::coord::Coord and its subclasses
- afw::coord::Observatory
- afw::coord::Weather
- afw::detection::Threshold
- afw::geom::Angle
- afw::geom::AngleUnit
- afw::geom::Box
- afw::geom::CoordinateBase and its subclasses
- afw::geom::CoordinateExpr
- afw::geom::Span
- afw::geom::SpherePoint
- afw::geom::polygon::Polygon
- afw::image::Calib
- afw::image::Color
- afw::image::DefectBase
- afw::image::Filter
- afw::image::FilterProperty
- afw::math::FitResults
- afw::math::Function and its subclasses
- afw::math::MaskedVector
- afw::math::Statistics
- afw::table::BaseRecord and its subclasses
- afw::table::ConstFunctorKey
- afw::table::FieldBase and its subclasses
- afw::table::InputFunctorKey and its subclasses
- afw::table::KeyBase and its subclasses
- afw::table::Match
- afw::table::OutputFunctorKey and its subclasses
- afw::table::ReferenceFunctorKey
- afw::table::SchemaItem
- afw::table::io::Persistable
- afw::table::io::PersistableFacade
This would be awesome!