From c2ad09706e2bae00581b9942041e0e8c91c4bb03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 19:31:24 +0100 Subject: [PATCH] Fixed compilation with GCC 4.9. Standards-conforming STL implementation has no implicit default constructor for std::vector, making me write this ugly verbose code. --- src/MeshTools/Test/GenerateFlatNormalsTest.cpp | 2 +- src/Plugins/MagnumFont/MagnumFont.cpp | 2 +- src/Primitives/Capsule.cpp | 8 ++++---- src/Primitives/Circle.cpp | 8 ++++---- src/Primitives/Crosshair.cpp | 8 ++++---- src/Primitives/Cube.cpp | 4 ++-- src/Primitives/Cylinder.cpp | 4 ++-- src/Primitives/Icosphere.cpp | 2 +- src/Primitives/Implementation/WireframeSpheroid.cpp | 2 +- src/Primitives/Line.cpp | 8 ++++---- src/Primitives/Plane.cpp | 6 +++--- src/Primitives/Square.cpp | 6 +++--- src/Primitives/UVSphere.cpp | 4 ++-- src/SceneGraph/Object.hpp | 8 ++++---- src/Text/AbstractFontConverter.cpp | 8 ++++---- src/Text/GlyphCache.cpp | 2 +- src/TextureTools/Atlas.cpp | 2 +- src/TextureTools/Test/AtlasTest.cpp | 2 +- 18 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/MeshTools/Test/GenerateFlatNormalsTest.cpp b/src/MeshTools/Test/GenerateFlatNormalsTest.cpp index fe3080cab..9e3f747d9 100644 --- a/src/MeshTools/Test/GenerateFlatNormalsTest.cpp +++ b/src/MeshTools/Test/GenerateFlatNormalsTest.cpp @@ -50,7 +50,7 @@ void GenerateFlatNormalsTest::wrongIndexCount() { std::vector normals; std::tie(indices, normals) = MeshTools::generateFlatNormals({ 0, 1 - }, {}); + }, std::vector{}); CORRADE_COMPARE(indices.size(), 0); CORRADE_COMPARE(normals.size(), 0); diff --git a/src/Plugins/MagnumFont/MagnumFont.cpp b/src/Plugins/MagnumFont/MagnumFont.cpp index f43ea8b24..9f9542a39 100644 --- a/src/Plugins/MagnumFont/MagnumFont.cpp +++ b/src/Plugins/MagnumFont/MagnumFont.cpp @@ -148,7 +148,7 @@ std::pair MagnumFont::doOpenFile(const std::string& filename, Floa std::pair MagnumFont::openInternal(Utility::Configuration&& conf, Trade::ImageData2D&& image) { /* Everything okay, save the data internally */ - _opened = new Data{std::move(conf), std::move(image), std::unordered_map{}, {}}; + _opened = new Data{std::move(conf), std::move(image), std::unordered_map{}, std::vector{}}; /* Glyph advances */ const std::vector glyphs = _opened->conf.groups("glyph"); diff --git a/src/Primitives/Capsule.cpp b/src/Primitives/Capsule.cpp index 852d23b8c..aec1057bf 100644 --- a/src/Primitives/Capsule.cpp +++ b/src/Primitives/Capsule.cpp @@ -34,7 +34,7 @@ namespace Magnum { namespace Primitives { Trade::MeshData2D Capsule2D::wireframe(UnsignedInt hemisphereRings, UnsignedInt cylinderRings, Float halfLength) { - CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData2D(Mesh::Primitive::Lines, {}, {}, {})); + CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData2D(Mesh::Primitive::Lines, std::vector{}, std::vector>{}, std::vector>{})); std::vector positions; positions.reserve(hemisphereRings*4+2+(cylinderRings-1)*2); @@ -85,11 +85,11 @@ Trade::MeshData2D Capsule2D::wireframe(UnsignedInt hemisphereRings, UnsignedInt {UnsignedInt(positions.size())-3, UnsignedInt(positions.size())-1, UnsignedInt(positions.size())-2, UnsignedInt(positions.size())-1}); - return Trade::MeshData2D(Mesh::Primitive::Lines, std::move(indices), {std::move(positions)}, {}); + return Trade::MeshData2D(Mesh::Primitive::Lines, std::move(indices), {std::move(positions)}, std::vector>{}); } Trade::MeshData3D Capsule3D::solid(UnsignedInt hemisphereRings, UnsignedInt cylinderRings, UnsignedInt segments, Float halfLength, TextureCoords textureCoords) { - CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 3, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, {}, {}, {}, {})); + CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 3, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::Spheroid capsule(segments, textureCoords == TextureCoords::Generate ? Implementation::Spheroid::TextureCoords::Generate : @@ -123,7 +123,7 @@ Trade::MeshData3D Capsule3D::solid(UnsignedInt hemisphereRings, UnsignedInt cyli } Trade::MeshData3D Capsule3D::wireframe(const UnsignedInt hemisphereRings, const UnsignedInt cylinderRings, const UnsignedInt segments, const Float halfLength) { - CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Capsule::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, {}, {}, {}, {})); + CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Capsule::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::WireframeSpheroid capsule(segments/4); diff --git a/src/Primitives/Circle.cpp b/src/Primitives/Circle.cpp index e6b019410..ac2d06e48 100644 --- a/src/Primitives/Circle.cpp +++ b/src/Primitives/Circle.cpp @@ -32,7 +32,7 @@ namespace Magnum { namespace Primitives { Trade::MeshData2D Circle::solid(UnsignedInt segments) { CORRADE_ASSERT(segments >= 3, "Primitives::Circle::solid(): segments must be >= 3", - Trade::MeshData2D(Mesh::Primitive::TriangleFan, {}, {}, {})); + Trade::MeshData2D(Mesh::Primitive::TriangleFan, std::vector{}, std::vector>{}, std::vector>{})); std::vector positions; positions.reserve(segments+1); @@ -47,12 +47,12 @@ Trade::MeshData2D Circle::solid(UnsignedInt segments) { positions.emplace_back(Math::cos(angle), Math::sin(angle)); } - return Trade::MeshData2D(Mesh::Primitive::TriangleFan, {}, {std::move(positions)}, {}); + return Trade::MeshData2D(Mesh::Primitive::TriangleFan, std::vector{}, {std::move(positions)}, std::vector>{}); } Trade::MeshData2D Circle::wireframe(UnsignedInt segments) { CORRADE_ASSERT(segments >= 3, "Primitives::Circle::wireframe(): segments must be >= 3", - Trade::MeshData2D(Mesh::Primitive::LineLoop, {}, {}, {})); + Trade::MeshData2D(Mesh::Primitive::LineLoop, std::vector{}, std::vector>{}, std::vector>{})); std::vector positions; positions.reserve(segments); @@ -64,7 +64,7 @@ Trade::MeshData2D Circle::wireframe(UnsignedInt segments) { positions.emplace_back(Math::cos(angle), Math::sin(angle)); } - return Trade::MeshData2D(Mesh::Primitive::LineLoop, {}, {std::move(positions)}, {}); + return Trade::MeshData2D(Mesh::Primitive::LineLoop, std::vector{}, {std::move(positions)}, std::vector>{}); } }} diff --git a/src/Primitives/Crosshair.cpp b/src/Primitives/Crosshair.cpp index a03aa2292..396cf24fa 100644 --- a/src/Primitives/Crosshair.cpp +++ b/src/Primitives/Crosshair.cpp @@ -31,18 +31,18 @@ namespace Magnum { namespace Primitives { Trade::MeshData2D Crosshair2D::wireframe() { - return Trade::MeshData2D(Mesh::Primitive::Lines, {}, {{ + return Trade::MeshData2D(Mesh::Primitive::Lines, std::vector{}, {{ {-1.0f, 0.0f}, {1.0f, 0.0f}, { 0.0f, -1.0f}, {0.0f, 1.0f} - }}, {}); + }}, std::vector>{}); } Trade::MeshData3D Crosshair3D::wireframe() { - return Trade::MeshData3D(Mesh::Primitive::Lines, {}, {{ + return Trade::MeshData3D(Mesh::Primitive::Lines, std::vector{}, {{ {-1.0f, 0.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, { 0.0f, -1.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, { 0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, 1.0f} - }}, {}, {}); + }}, std::vector>{}, std::vector>{}); } }} diff --git a/src/Primitives/Cube.cpp b/src/Primitives/Cube.cpp index 084a2e9b2..6809b723b 100644 --- a/src/Primitives/Cube.cpp +++ b/src/Primitives/Cube.cpp @@ -97,7 +97,7 @@ Trade::MeshData3D Cube::solid() { {-1.0f, 0.0f, 0.0f}, {-1.0f, 0.0f, 0.0f}, /* -X */ {-1.0f, 0.0f, 0.0f} - }}, {}); + }}, std::vector>{}); } Trade::MeshData3D Cube::wireframe() { @@ -116,7 +116,7 @@ Trade::MeshData3D Cube::wireframe() { { 1.0f, -1.0f, -1.0f}, { 1.0f, 1.0f, -1.0f}, {-1.0f, 1.0f, -1.0f} - }}, {}, {}); + }}, std::vector>{}, std::vector>{}); } }} diff --git a/src/Primitives/Cylinder.cpp b/src/Primitives/Cylinder.cpp index da6b28b81..4f02a8d6d 100644 --- a/src/Primitives/Cylinder.cpp +++ b/src/Primitives/Cylinder.cpp @@ -32,7 +32,7 @@ namespace Magnum { namespace Primitives { Trade::MeshData3D Cylinder::solid(const UnsignedInt rings, const UnsignedInt segments, const Float halfLength, const Flags flags) { - CORRADE_ASSERT(rings >= 1 && segments >= 3, "Primitives::Cylinder::solid(): cylinder must have at least one ring and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, {}, {}, {}, {})); + CORRADE_ASSERT(rings >= 1 && segments >= 3, "Primitives::Cylinder::solid(): cylinder must have at least one ring and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::Spheroid cylinder(segments, flags & Flag::GenerateTextureCoords ? Implementation::Spheroid::TextureCoords::Generate : Implementation::Spheroid::TextureCoords::DontGenerate); @@ -63,7 +63,7 @@ Trade::MeshData3D Cylinder::solid(const UnsignedInt rings, const UnsignedInt seg } Trade::MeshData3D Cylinder::wireframe(const UnsignedInt rings, const UnsignedInt segments, const Float halfLength) { - CORRADE_ASSERT(rings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Cylinder::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, {}, {}, {}, {})); + CORRADE_ASSERT(rings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Cylinder::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::WireframeSpheroid cylinder(segments/4); diff --git a/src/Primitives/Icosphere.cpp b/src/Primitives/Icosphere.cpp index 452e38eb3..3ec685aa3 100644 --- a/src/Primitives/Icosphere.cpp +++ b/src/Primitives/Icosphere.cpp @@ -78,7 +78,7 @@ Trade::MeshData3D Icosphere::solid(const UnsignedInt subdivisions) { MeshTools::removeDuplicates(indices, positions); std::vector normals(positions); - return Trade::MeshData3D(Mesh::Primitive::Triangles, std::move(indices), {std::move(positions)}, {std::move(normals)}, {}); + return Trade::MeshData3D(Mesh::Primitive::Triangles, std::move(indices), {std::move(positions)}, {std::move(normals)}, std::vector>{}); } }} diff --git a/src/Primitives/Implementation/WireframeSpheroid.cpp b/src/Primitives/Implementation/WireframeSpheroid.cpp index 67bbaeed4..a53d7f371 100644 --- a/src/Primitives/Implementation/WireframeSpheroid.cpp +++ b/src/Primitives/Implementation/WireframeSpheroid.cpp @@ -109,7 +109,7 @@ void WireframeSpheroid::cylinder() { } Trade::MeshData3D WireframeSpheroid::finalize() { - return Trade::MeshData3D(Mesh::Primitive::Lines, std::move(_indices), {std::move(_positions)}, {}, {}); + return Trade::MeshData3D(Mesh::Primitive::Lines, std::move(_indices), {std::move(_positions)}, std::vector>{}, std::vector>{}); } }}} diff --git a/src/Primitives/Line.cpp b/src/Primitives/Line.cpp index fc0da8207..016f6d082 100644 --- a/src/Primitives/Line.cpp +++ b/src/Primitives/Line.cpp @@ -31,15 +31,15 @@ namespace Magnum { namespace Primitives { Trade::MeshData2D Line2D::wireframe() { - return Trade::MeshData2D(Mesh::Primitive::Lines, {}, {{ + return Trade::MeshData2D(Mesh::Primitive::Lines, std::vector{}, {{ {0.0f, 0.0f}, {1.0f, 0.0f} - }}, {}); + }}, std::vector>{}); } Trade::MeshData3D Line3D::wireframe() { - return Trade::MeshData3D(Mesh::Primitive::Lines, {}, {{ + return Trade::MeshData3D(Mesh::Primitive::Lines, std::vector{}, {{ {0.0f, 0.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, - }}, {}, {}); + }}, std::vector>{}, std::vector>{}); } }} diff --git a/src/Primitives/Plane.cpp b/src/Primitives/Plane.cpp index dc889f75d..a454ef645 100644 --- a/src/Primitives/Plane.cpp +++ b/src/Primitives/Plane.cpp @@ -38,7 +38,7 @@ Trade::MeshData3D Plane::solid(const TextureCoords textureCoords) { {0.0f, 1.0f} }); - return Trade::MeshData3D(Mesh::Primitive::TriangleStrip, {}, {{ + return Trade::MeshData3D(Mesh::Primitive::TriangleStrip, std::vector{}, {{ {1.0f, -1.0f, 0.0f}, {1.0f, 1.0f, 0.0f}, {-1.0f, -1.0f, 0.0f}, @@ -52,12 +52,12 @@ Trade::MeshData3D Plane::solid(const TextureCoords textureCoords) { } Trade::MeshData3D Plane::wireframe() { - return Trade::MeshData3D(Mesh::Primitive::LineLoop, {}, {{ + return Trade::MeshData3D(Mesh::Primitive::LineLoop, std::vector{}, {{ {-1.0f, -1.0f, 0.0f}, {1.0f, -1.0f, 0.0f}, {1.0f, 1.0f, 0.0f}, {-1.0f, 1.0f, 0.0f} - }}, {}, {}); + }}, std::vector>{}, std::vector>{}); } }} diff --git a/src/Primitives/Square.cpp b/src/Primitives/Square.cpp index 8f86b1dd3..93e72b198 100644 --- a/src/Primitives/Square.cpp +++ b/src/Primitives/Square.cpp @@ -38,7 +38,7 @@ Trade::MeshData2D Square::solid(const TextureCoords textureCoords) { {0.0f, 1.0f} }); - return Trade::MeshData2D(Mesh::Primitive::TriangleStrip, {}, {{ + return Trade::MeshData2D(Mesh::Primitive::TriangleStrip, std::vector{}, {{ {1.0f, -1.0f}, {1.0f, 1.0f}, {-1.0f, -1.0f}, @@ -47,12 +47,12 @@ Trade::MeshData2D Square::solid(const TextureCoords textureCoords) { } Trade::MeshData2D Square::wireframe() { - return Trade::MeshData2D(Mesh::Primitive::LineLoop, {}, {{ + return Trade::MeshData2D(Mesh::Primitive::LineLoop, std::vector{}, {{ {-1.0f, -1.0f}, {1.0f, -1.0f}, {1.0f, 1.0f}, {-1.0f, 1.0f} - }}, {}); + }}, std::vector>{}); } }} diff --git a/src/Primitives/UVSphere.cpp b/src/Primitives/UVSphere.cpp index 75e67ba5e..dd0c23972 100644 --- a/src/Primitives/UVSphere.cpp +++ b/src/Primitives/UVSphere.cpp @@ -32,7 +32,7 @@ namespace Magnum { namespace Primitives { Trade::MeshData3D UVSphere::solid(UnsignedInt rings, UnsignedInt segments, TextureCoords textureCoords) { - CORRADE_ASSERT(rings >= 2 && segments >= 3, "UVSphere must have at least two rings and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, {}, {}, {}, {})); + CORRADE_ASSERT(rings >= 2 && segments >= 3, "UVSphere must have at least two rings and three segments", Trade::MeshData3D(Mesh::Primitive::Triangles, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::Spheroid sphere(segments, textureCoords == TextureCoords::Generate ? Implementation::Spheroid::TextureCoords::Generate : @@ -59,7 +59,7 @@ Trade::MeshData3D UVSphere::solid(UnsignedInt rings, UnsignedInt segments, Textu } Trade::MeshData3D UVSphere::wireframe(const UnsignedInt rings, const UnsignedInt segments) { - CORRADE_ASSERT(rings >= 2 && rings%2 == 0 && segments >= 4 && segments%2 == 0, "Primitives::UVSphere::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, {}, {}, {}, {})); + CORRADE_ASSERT(rings >= 2 && rings%2 == 0 && segments >= 4 && segments%2 == 0, "Primitives::UVSphere::wireframe(): improper parameters", Trade::MeshData3D(Mesh::Primitive::Lines, std::vector{}, std::vector>{}, std::vector>{}, std::vector>{})); Implementation::WireframeSpheroid sphere(segments/4); diff --git a/src/SceneGraph/Object.hpp b/src/SceneGraph/Object.hpp index f30ae68ed..a234549dc 100644 --- a/src/SceneGraph/Object.hpp +++ b/src/SceneGraph/Object.hpp @@ -194,7 +194,7 @@ computed and recursively concatenated together. Resulting transformations for joints which were originally in `object` list is then returned. */ template std::vector Object::transformations(std::vector*> objects, const typename Transformation::DataType& initialTransformation) const { - CORRADE_ASSERT(objects.size() < 0xFFFFu, "SceneGraph::Object::transformations(): too large scene", {}); + CORRADE_ASSERT(objects.size() < 0xFFFFu, "SceneGraph::Object::transformations(): too large scene", std::vector{}); /* Remember object count for later */ std::size_t objectCount = objects.size(); @@ -217,7 +217,7 @@ template std::vector Ob const Scene* scene = this->scene(); /* Nearest common ancestor not yet implemented - assert this is done on scene */ - CORRADE_ASSERT(scene == this, "SceneGraph::Object::transformationMatrices(): currently implemented only for Scene", {}); + CORRADE_ASSERT(scene == this, "SceneGraph::Object::transformationMatrices(): currently implemented only for Scene", std::vector{}); /* Mark all objects up the hierarchy as visited */ auto it = objects.begin(); @@ -235,7 +235,7 @@ template std::vector Ob /* If this is root object, remove from list */ if(!parent) { - CORRADE_ASSERT(*it == scene, "SceneGraph::Object::transformations(): the objects are not part of the same tree", {}); + CORRADE_ASSERT(*it == scene, "SceneGraph::Object::transformations(): the objects are not part of the same tree", std::vector{}); it = objects.erase(it); /* Parent is an joint or already visited - remove current from list */ @@ -246,7 +246,7 @@ template std::vector Ob list of joint objects */ if(!(parent->flags & Flag::Joint)) { CORRADE_ASSERT(jointObjects.size() < 0xFFFFu, - "SceneGraph::Object::transformations(): too large scene", {}); + "SceneGraph::Object::transformations(): too large scene", std::vector{}); CORRADE_INTERNAL_ASSERT(parent->counter == 0xFFFFu); parent->counter = jointObjects.size(); parent->flags |= Flag::Joint; diff --git a/src/Text/AbstractFontConverter.cpp b/src/Text/AbstractFontConverter.cpp index 055a15eb2..e754e00ff 100644 --- a/src/Text/AbstractFontConverter.cpp +++ b/src/Text/AbstractFontConverter.cpp @@ -40,7 +40,7 @@ AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager* man std::vector>> AbstractFontConverter::exportFontToData(AbstractFont& font, GlyphCache& cache, const std::string& filename, const std::string& characters) const { CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData), - "Text::AbstractFontConverter::exportFontToData(): feature not supported", {}); + "Text::AbstractFontConverter::exportFontToData(): feature not supported", (std::vector>>{})); return doExportFontToData(font, cache, filename, uniqueUnicode(characters)); } @@ -52,7 +52,7 @@ std::vector>> AbstractFo #endif { CORRADE_ASSERT(!(features() & Feature::MultiFile), - "Text::AbstractFontConverter::exportFontToData(): feature advertised but not implemented", {}); + "Text::AbstractFontConverter::exportFontToData(): feature advertised but not implemented", (std::vector>>{})); std::vector>> out; out.emplace_back(filename, std::move(doExportFontToSingleData(font, cache, characters))); @@ -113,14 +113,14 @@ bool AbstractFontConverter::doExportFontToFile(AbstractFont& font, GlyphCache& c std::vector>> AbstractFontConverter::exportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const { CORRADE_ASSERT(features() >= (Feature::ExportGlyphCache|Feature::ConvertData), - "Text::AbstractFontConverter::exportGlyphCacheToData(): feature not supported", {}); + "Text::AbstractFontConverter::exportGlyphCacheToData(): feature not supported", (std::vector>>{})); return doExportGlyphCacheToData(cache, filename); } std::vector>> AbstractFontConverter::doExportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const { CORRADE_ASSERT(!(features() & Feature::MultiFile), - "Text::AbstractFontConverter::exportGlyphCacheToData(): feature advertised but not implemented", {}); + "Text::AbstractFontConverter::exportGlyphCacheToData(): feature advertised but not implemented", (std::vector>>{})); std::vector>> out; out.emplace_back(filename, std::move(doExportGlyphCacheToSingleData(cache))); diff --git a/src/Text/GlyphCache.cpp b/src/Text/GlyphCache.cpp index 2202c5930..d9700a1a8 100644 --- a/src/Text/GlyphCache.cpp +++ b/src/Text/GlyphCache.cpp @@ -80,7 +80,7 @@ void GlyphCache::initialize(const TextureFormat internalFormat, const Vector2i& std::vector GlyphCache::reserve(const std::vector& sizes) { CORRADE_ASSERT((glyphs.size() == 1 && glyphs.at(0) == std::pair()), - "Text::GlyphCache::reserve(): reserving space in non-empty cache is not yet implemented", {}); + "Text::GlyphCache::reserve(): reserving space in non-empty cache is not yet implemented", std::vector{}); glyphs.reserve(glyphs.size() + sizes.size()); return TextureTools::atlas(_size, sizes, _padding); } diff --git a/src/TextureTools/Atlas.cpp b/src/TextureTools/Atlas.cpp index 08398437c..89f17dbc5 100644 --- a/src/TextureTools/Atlas.cpp +++ b/src/TextureTools/Atlas.cpp @@ -30,7 +30,7 @@ namespace Magnum { namespace TextureTools { std::vector atlas(const Vector2i& atlasSize, const std::vector& sizes, const Vector2i& padding) { - if(sizes.empty()) return {}; + if(sizes.empty()) return std::vector{}; /* Size of largest texture */ Vector2i maxSize; diff --git a/src/TextureTools/Test/AtlasTest.cpp b/src/TextureTools/Test/AtlasTest.cpp index 4bbb21ddd..178a57803 100644 --- a/src/TextureTools/Test/AtlasTest.cpp +++ b/src/TextureTools/Test/AtlasTest.cpp @@ -76,7 +76,7 @@ void AtlasTest::createPadding() { } void AtlasTest::createEmpty() { - std::vector atlas = TextureTools::atlas({}, {}); + std::vector atlas = TextureTools::atlas({}, std::vector{}); CORRADE_VERIFY(atlas.empty()); }