arcoth / constainer Goto Github PK
View Code? Open in Web Editor NEWA constexpr string, container and algorithm library for C++14/1Z.
License: Boost Software License 1.0
A constexpr string, container and algorithm library for C++14/1Z.
License: Boost Software License 1.0
This issue occurs in e.g. the following scenario:
constexpr auto f() {return StableVector<int, ChunkPool<int, 10>>{1};}
static_assert( f()[0] );
Clang's error message:
….cxx:4:16: error: static_assert expression is not an integral constant expression
static_assert( f()[0] );
^~~~~~
….cxx:4:16: note: read of temporary whose lifetime has ended
….cxx:3:28: note: temporary created here
constexpr auto f() {return StableVector<int, ChunkPool<int, 10>>{1};}
^
Whether this is a bug or not isn't entirely clear, but the former is probably the case, as e.g. AddressSanitizer doesn't show anything.
constexpr Array<int, 10> a {{1, 2, 3, 4, 5}};
constexpr Array<int, 10> a2{{1, 2, 3, 4, 5}};
static_assert( a == a2 );
Fails with GCC trunk 20150813:
Constainer/Testing.cxx:23:1: error: non-constant condition for static assertion
static_assert( a == a2 );
^
In file included from Constainer/impl/../Array.hxx:7:0,
from Constainer/impl/BasicVector.hxx:7,
from Constainer/String.hxx:8,
from Constainer/Parser.hxx:7,
from Constainer/Testing.cxx:7:
Constainer/Testing.cxx:23:18: in constexpr expansion of ‘Constainer::operator==<int, 10ul, int, 10ul>(a, a2)’
Constainer/impl/../Array.hxx:89:14: in constexpr expansion of ‘Constainer::equal<const int*, const int*>((& lhs)->Constainer::Array<T, Size>::begin<int, 10ul>(), (& lhs)->Constainer::Array<T, Size>::end<int, 10ul>(), (& rhs)->Constainer::Array<T, Size>::begin<int, 10ul>(), (& rhs)->Constainer::Array<T, Size>::end<int, 10ul>())’
Constainer/impl/../Algorithms.hxx:269:26: in constexpr expansion of ‘Constainer::equal<const int*, const int*, std::equal_to<void> >(first1, last1, first2, last2, (std::equal_to<void>(), std::equal_to<void>()))’
Constainer/impl/../Algorithms.hxx:264:31: in constexpr expansion of ‘Constainer::mismatch<const int*, const int*, std::equal_to<void> >(first1, last1, first2, last2, (comp, std::equal_to<void>()))’
Constainer/impl/../Algorithms.hxx:220:2: error: ‘(((const int*)(& a.Constainer::Array<int, 10ul>::_storage)) == (((const int*)(& a.Constainer::Array<int, 10ul>::_storage)) + 40u))’ is not a constant expression
while (first1 != last1 && first2 != last2) {
^
Reduces to
struct A {int arr[3] {1, 2, 3};} constexpr a{};
static_assert( a.arr != a.arr+3 );
GCC spits out a bunch of error messages corresponding to all partial specializations of handleFormatSpecifier
:
…/StaticPrintf.hxx:412:9: error: template argument ‘Tokens:: character’ involves template parameter(s)
struct handleFormatSpecifier<Tokens::character, ch...> : handleRest<ch...> {
^
GCC doesn't properly distinguish between template parameters of a member template and the surrounding template when testing validity of specialized non-type arguments in partial specializations. Filed as #67593.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.