From 2127457eeb8da4382dffd7c66be03706b1059ae2 Mon Sep 17 00:00:00 2001 From: Igor Chorazewicz Date: Thu, 13 Jun 2019 18:04:19 +0200 Subject: [PATCH] Mark allocation_flag constructor as explicit. Having implicit constructor caused unexpected beahviour with make_persistent_array. For make_persistent version designed to work with sized arrays calling make_persistent(90) didn't failed as expected. Instead, '90' was implicitly converted to allocation_flag. --- include/libpmemobj++/allocation_flag.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libpmemobj++/allocation_flag.hpp b/include/libpmemobj++/allocation_flag.hpp index 689268e27c..644c3c5277 100644 --- a/include/libpmemobj++/allocation_flag.hpp +++ b/include/libpmemobj++/allocation_flag.hpp @@ -61,7 +61,7 @@ struct allocation_flag { /** * Emplace constructor. */ - allocation_flag(uint64_t val) : value(val) + explicit allocation_flag(uint64_t val) : value(val) { } @@ -124,7 +124,7 @@ struct allocation_flag_atomic { /** * Emplace constructor. */ - allocation_flag_atomic(uint64_t val) : value(val) + explicit allocation_flag_atomic(uint64_t val) : value(val) { }