Browse Source

GL: mark the 4-argument DynamicAttribute constructor as explicit.

Should have been done since ever, considering it was not annotated with
/*implicit*/.
pull/420/head
Vladimír Vondruš 6 years ago
parent
commit
f53adefe96
  1. 3
      doc/changelog.dox
  2. 4
      src/Magnum/GL/Attribute.h

3
doc/changelog.dox

@ -258,6 +258,9 @@ See also:
@ref Animation library was changed to allow mutable access to the keys &
values it references. Existing code needs to be changed to say
@cpp TrackView<const K, const V> @ce instead of @cpp TrackView<K, V> @ce.
- The 4-argument @ref GL::DynamicAttribute constructor was not marked as
@cpp explicit @ce by mistake, it's done now to enforce readability in long
expressions.
- @ref Math::Matrix3::scaling() const and @ref Math::Matrix4::scaling() const
now return a signed scaling vector instead of unsigned in order to prevent
information loss. To restore the old behavior, apply @ref Math::abs() on

4
src/Magnum/GL/Attribute.h

@ -513,13 +513,13 @@ class DynamicAttribute {
* @param components Component count
* @param dataType Type of passed data
*/
constexpr DynamicAttribute(Kind kind, UnsignedInt location, Components components, DataType dataType): _kind{kind}, _location{location}, _components{components}, _dataType{dataType} {}
constexpr explicit DynamicAttribute(Kind kind, UnsignedInt location, Components components, DataType dataType): _kind{kind}, _location{location}, _components{components}, _dataType{dataType} {}
/**
* @brief Construct from a compile-time attribute
* @m_since{2019,10}
*/
template<UnsignedInt location_, class T> constexpr DynamicAttribute(const Attribute<location_, T>& attribute);
template<UnsignedInt location_, class T> constexpr /*implicit*/ DynamicAttribute(const Attribute<location_, T>& attribute);
/** @brief Attribute kind */
constexpr Kind kind() const { return _kind; }

Loading…
Cancel
Save