Le 19/05/2024 à 20:20, Jean-Marc Lasgouttes a écrit :
If you look at the error details, it seems to me that the addresses are
different. But this is weird.
Note that we can use count() instead of find(), which would solve the
issue.
What about that? It seems that the compiler was right after all. This is
where using assertions instead of full stdlib-debug is sub-optimal.
This does not mean that we should not use std::set::count().
JMarc
From 4868c1b7ce4f45bb288ead575cda67c392b02a99 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Sun, 19 May 2024 20:45:20 +0200
Subject: [PATCH] Do not return InsetLayout::required() as a copy
Otherwise (aside from performance aspects) a test like
il.required().find("url") != il.required().end()
does not make sense.
---
src/insets/InsetLayout.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/insets/InsetLayout.h b/src/insets/InsetLayout.h
index 36a3c91bbf..0848adef45 100644
--- a/src/insets/InsetLayout.h
+++ b/src/insets/InsetLayout.h
@@ -200,7 +200,7 @@ public:
///
bool docbookrenderasimage() const { return docbookrenderasimage_; }
///
- std::set<std::string> required() const { return required_; }
+ std::set<std::string> required() const & { return required_; }
///
bool isMultiPar() const { return multipar_; }
///
--
2.40.1
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel