[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] libstdc++ concept checks vs std::regex
From: |
Greg Chicares |
Subject: |
[lmi] libstdc++ concept checks vs std::regex |
Date: |
Tue, 17 May 2016 13:08:05 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 |
Apparently we can either abandon libstdc++'s concept checks (which
do have some value), or not use some set of C++11 features that I
cannot today enumerate beyond demonstrating that it includes <regex>.
https://gcc.gnu.org/onlinedocs/libstdc++/manual/concept_checking.html
| Please note that the checks are based on the requirements in the
| original C++ standard, many of which were relaxed in the C++11
| standard and so valid C++11 code may be incorrectly rejected by
| the concept checks. Additionally, some correct C++03 code might be
| rejected ... There are no plans to address these shortcomings.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Does this mean it has gone the way of '-fcheck-memory-usage'?
https://gcc.gnu.org/ml/gcc/2002-02/msg00666.html
| Basically, it just didn't work any more, and it was decided to take it
| out to not create false expectations.
Is an alternative tool available to perform concept checking?
Or should we even consider defining the concept-checking macros
only for code that doesn't use any of this as-yet-unknown set of
modern C++ features?
Demonstration:
----------8<----------
Index: sandbox_test.cpp
===================================================================
--- sandbox_test.cpp(revision 6591)
+++ sandbox_test.cpp(working copy)
@@ -28,8 +28,12 @@
#include "test_tools.hpp"
+#include <regex>
+
int test_main(int, char*[])
{
+ std::regex("abc");
+
return 0;
}
---------->8----------
make unit_tests unit_test_targets=sandbox_test.exe build_type=safestdlib
C:/opt/lmi/MinGW-4_9_1/i686-w64-mingw32/include/c++/bits/boost_concept_check.h:206:11:
error: use of deleted function
'std::__detail::_StateSeq<std::regex_traits<char> >&
std::__detail::_StateSeq<std::regex_traits<char> >::operator=(const
std::__detail::_StateSeq<std::regex_traits<char> >&)'
__a = __a; // require assignment operator
^
Et cetera, et cetera, et cetera...
- [lmi] libstdc++ concept checks vs std::regex,
Greg Chicares <=