From 6bbd6cbda38e4345425bbfca2be1e3bc2069c8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacy=20Gaw=C4=99dzki?= Date: Wed, 24 Jul 2024 15:18:29 +0200 Subject: [PATCH] Fix mutant_relation::operator=. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Defining template mutant_relation& operator=(const mutant_relation& rel) { base_::change_to(rel); return *this; } does not prevent the compiler from implicitly providing mutant_relation& operator=(const mutant_relation&); and hence the implicit version takes over when FM == force_mutable and does not call base_::change_to. Replace the template version with two non-template overloads, both calling base_::change_to. Signed-off-by: Ignacy Gawędzki --- include/boost/bimap/relation/mutant_relation.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/boost/bimap/relation/mutant_relation.hpp b/include/boost/bimap/relation/mutant_relation.hpp index 1681a9d0..eda9a8c9 100644 --- a/include/boost/bimap/relation/mutant_relation.hpp +++ b/include/boost/bimap/relation/mutant_relation.hpp @@ -289,8 +289,14 @@ class mutant_relation : public // Operators - template< bool FM > - mutant_relation& operator=(const mutant_relation & rel) + mutant_relation& operator=(const mutant_relation & rel) + { + base_::change_to(rel); + return *this; + } + + mutant_relation& operator=(const mutant_relation & rel) { base_::change_to(rel); return *this;