Skip to content

Commit 6c01ee3

Browse files
committed
Remove operator=(Asset&&)
1 parent e22ca3e commit 6c01ee3

File tree

2 files changed

+5
-41
lines changed

2 files changed

+5
-41
lines changed

include/fastgltf/types.hpp

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,10 +1935,6 @@ namespace fastgltf {
19351935
Optional<SparseAccessor> sparse;
19361936

19371937
FASTGLTF_STD_PMR_NS::string name;
1938-
1939-
explicit Accessor() = default;
1940-
Accessor(const Accessor& accessor) = default;
1941-
Accessor(Accessor&& accessor) noexcept = default;
19421938
};
19431939

19441940
struct CompressedBufferView {
@@ -2058,31 +2054,7 @@ namespace fastgltf {
20582054
availableCategories(other.availableCategories) {}
20592055

20602056
Asset& operator=(const Asset& other) = delete;
2061-
Asset& operator=(Asset&& other) noexcept {
2062-
#if !FASTGLTF_DISABLE_CUSTOM_MEMORY_POOL
2063-
memoryResource = std::move(other.memoryResource);
2064-
#endif
2065-
assetInfo = std::move(other.assetInfo);
2066-
extensionsUsed = std::move(other.extensionsUsed);
2067-
extensionsRequired = std::move(other.extensionsRequired);
2068-
defaultScene = other.defaultScene;
2069-
accessors = std::move(other.accessors);
2070-
animations = std::move(other.animations);
2071-
buffers = std::move(other.buffers);
2072-
bufferViews = std::move(other.bufferViews);
2073-
cameras = std::move(other.cameras);
2074-
images = std::move(other.images);
2075-
lights = std::move(other.lights);
2076-
materials = std::move(other.materials);
2077-
meshes = std::move(other.meshes);
2078-
nodes = std::move(other.nodes);
2079-
samplers = std::move(other.samplers);
2080-
scenes = std::move(other.scenes);
2081-
skins = std::move(other.skins);
2082-
textures = std::move(other.textures);
2083-
availableCategories = other.availableCategories;
2084-
return *this;
2085-
}
2057+
Asset& operator=(Asset&& other) noexcept = delete;
20862058
};
20872059
#pragma endregion
20882060
} // namespace fastgltf

tests/benchmarks.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ TEST_CASE("Benchmark loading of NewSponza", "[gltf-benchmark]") {
106106
auto jsonData = std::make_unique<fastgltf::GltfDataBuffer>();
107107
REQUIRE(jsonData->fromByteView(bytes.data(), bytes.size() - fastgltf::getGltfBufferPadding(), bytes.size()));
108108

109-
// Extract this from the benchmark loop, as otherwise we benchmark the asset destruction/deallocation too.
110-
fastgltf::Expected<fastgltf::Asset> asset(fastgltf::Error::None);
111109
BENCHMARK("Parse NewSponza") {
112-
asset = parser.loadGltfJson(jsonData.get(), intelSponza, benchmarkOptions);
110+
return parser.loadGltfJson(jsonData.get(), intelSponza, benchmarkOptions);
113111
};
114112

115113
#ifdef HAS_TINYGLTF
@@ -158,10 +156,8 @@ TEST_CASE("Benchmark base64 decoding from glTF file", "[gltf-benchmark]") {
158156
auto jsonData = std::make_unique<fastgltf::GltfDataBuffer>();
159157
REQUIRE(jsonData->fromByteView(bytes.data(), bytes.size() - fastgltf::getGltfBufferPadding(), bytes.size()));
160158

161-
// Extract this from the benchmark loop, as otherwise we benchmark the asset destruction/deallocation too.
162-
fastgltf::Expected<fastgltf::Asset> asset(fastgltf::Error::None);
163159
BENCHMARK("Parse 2CylinderEngine and decode base64") {
164-
asset = parser.loadGltfJson(jsonData.get(), cylinderEngine, benchmarkOptions);
160+
return parser.loadGltfJson(jsonData.get(), cylinderEngine, benchmarkOptions);
165161
};
166162

167163
#ifdef HAS_TINYGLTF
@@ -214,10 +210,8 @@ TEST_CASE("Benchmark raw JSON parsing", "[gltf-benchmark]") {
214210
auto jsonData = std::make_unique<fastgltf::GltfDataBuffer>();
215211
REQUIRE(jsonData->fromByteView(bytes.data(), bytes.size() - fastgltf::getGltfBufferPadding(), bytes.size()));
216212

217-
// Extract this from the benchmark loop, as otherwise we benchmark the asset destruction/deallocation too.
218-
fastgltf::Expected<fastgltf::Asset> asset(fastgltf::Error::None);
219213
BENCHMARK("Parse Buggy.gltf") {
220-
asset = parser.loadGltfJson(jsonData.get(), buggyPath, benchmarkOptions);
214+
return parser.loadGltfJson(jsonData.get(), buggyPath, benchmarkOptions);
221215
};
222216

223217
#ifdef HAS_TINYGLTF
@@ -271,10 +265,8 @@ TEST_CASE("Benchmark massive gltf file", "[gltf-benchmark]") {
271265
auto jsonData = std::make_unique<fastgltf::GltfDataBuffer>();
272266
REQUIRE(jsonData->fromByteView(bytes.data(), bytes.size() - fastgltf::getGltfBufferPadding(), bytes.size()));
273267

274-
// Extract this from the benchmark loop, as otherwise we benchmark the asset destruction/deallocation too.
275-
fastgltf::Expected<fastgltf::Asset> asset(fastgltf::Error::None);
276268
BENCHMARK("Parse Bistro") {
277-
asset = parser.loadGltfJson(jsonData.get(), bistroPath, benchmarkOptions);
269+
return parser.loadGltfJson(jsonData.get(), bistroPath, benchmarkOptions);
278270
};
279271

280272
#ifdef HAS_TINYGLTF

0 commit comments

Comments
 (0)