usnistgov / NetSimulyzer-ns3-module

A flexible 3D visualizer for displaying, debugging, presenting, and understanding ns-3 scenarios.
Other
33 stars 5 forks source link

Allow assignment of common attribute values to `OptionalValue` #24

Open bpe2 opened 3 years ago

bpe2 commented 3 years ago

It's somewhat inconvenient when assigning values to optional attributes to type out the full, templated type. This also causes confusion when assigning those attributes, as it may not be easy to recall for the user which attributes require this extra work.

Allow OptionalValue to be implicitly converted from another value type corresponding to its contained type (e.g., OptionalValue<double> should be able to be constructed by a DoubleValue). Since this requires manual conversions. only cover the common attribute types for these values