Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_section.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-07-29 21:29:38 +0200
committerMartin Hořeňovský2020-07-29 21:51:10 +0200
commitc5037743e6834c3abcf942cb02a29c6119ecc699 (patch)
tree274f7ae5d68296e4271f17433e4ecd9baee33da8 /src/catch2/internal/catch_section.cpp
parent9d6ac62affc0ea775438636351929ab8521ddc26 (diff)
downloadcatch3-c5037743e6834c3abcf942cb02a29c6119ecc699.tar.gz
Avoid copying SectionInfo while construction Section
Diffstat (limited to 'src/catch2/internal/catch_section.cpp')
-rw-r--r--src/catch2/internal/catch_section.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/catch2/internal/catch_section.cpp b/src/catch2/internal/catch_section.cpp
index 52361584..9db6ca9f 100644
--- a/src/catch2/internal/catch_section.cpp
+++ b/src/catch2/internal/catch_section.cpp
@@ -10,12 +10,14 @@
#include <catch2/internal/catch_test_macro_impl.hpp>
#include <catch2/internal/catch_uncaught_exceptions.hpp>
+#include <utility>
+
namespace Catch {
- Section::Section( SectionInfo const& info )
- : m_info( info ),
- m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )
- {
+ Section::Section( SectionInfo&& info ):
+ m_info( std::move( info ) ),
+ m_sectionIncluded(
+ getResultCapture().sectionStarted( m_info, m_assertions ) ) {
// Non-"included" sections will not use the timing information
// anyway, so don't bother with the potential syscall.
if (m_sectionIncluded) {