Standard Algorithms and Firebird Containers.

24 views
Skip to first unread message

Denis Simonov

unread,
Jul 14, 2026, 6:30:54 AMJul 14
to firebird-devel
Change https://github.com/FirebirdSQL/firebird/commit/ea6549f2f66b46c28b3932e4d56294f80ef77d22 breaks the build in many gcc and clang compilers. The cause is an attempt to use the std::find_if function from <algorithm>.

To use standard algorithms, iterators must meet a number of requirements, such as having an iterator_category, value_type, and so on. Unfortunately, GenericMap doesn't have definitions that can be used in iterator_traits, and therefore, in standard library algorithms. Of our classes, only Array defines iterator types. However, even there, they are defined in a deprecated form. Ideally, we should either bring our container iterators into compliance with the standard library requirements or abandon the standard algorithms when working with them.

P.S. It would be a good idea to start using concepts in some places.

Dimitry Sibiryakov

unread,
Jul 14, 2026, 7:01:47 AMJul 14
to firebir...@googlegroups.com
Denis Simonov wrote 14.07.2026 12:30:
> P.S. It would be a good idea to start using concepts in some places.

According to this discussion, until C++20 the only way to enforce named
requirement is to copy-paste pieces of STL:
https://stackoverflow.com/questions/60356977/is-there-an-easy-way-to-test-your-code-against-standards-named-requirements

And the problem of exceptions thrown by STL is still not solved.

--
WBR, SD.
Reply all
Reply to author
Forward
0 new messages