I am regular conference speaker, trainer, and C++ contractor.
I am available for code reviews and on-site training.
- Host of the YouTube channel C++ Weekly
- Ex-co-host of CppCast
- C++ T-Shirts available!
License: MIT License
I am regular conference speaker, trainer, and C++ contractor.
I am available for code reviews and on-site training.
The following testcase will fail:
constexpr auto number_val = JSON::number_parser()("0.0625"sv);
static_assert(number_val && number_val->first == 0.0625);
Parsed value is 0.625
GCC 7 and earlier have a bug (Bug 70167) that it treats T{}
in the same way as C99 compound literals. This was recently fixed, with the result that the trunk gcc now correctly gives errors for the construct constexpr std::initializer_list<T> il{Ts...};
in cx_json_parser.h
as il
is not initialized by a constant expression (the standard specifies this initialization as involving pointers to a temporary object on the stack...).
Hi, I watched the talk on CppCon2017 and tried to compile the piece of code with gcc-trunk but the compiler would say something like:
variable ‘b’ set but not used [-Werror=unused-but-set-variable]
My compiler version is
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/phi/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./../gcc-trunk/configure --prefix=/home/phi/gcc-trunk --enable-languages=c,c++ : (reconfigured) /media/phi/a60c856b-88ad-4199-ab95-a49fc0c9466a/codebase/gcc-infrastructure/objdir/../gcc-trunk/configure --prefix=/home/phi/gcc-trunk --enable-languages=c,c++
Thread model: posix
gcc version 8.0.0 20171123 (experimental) (GCC)
I use the command
cd build && cmake -D CMAKE_CXX_COMPILER=/home/phi/gcc-trunk/bin/g++ CMAKE_C_COMPILER=/home/phi/gcc-trunk/bin/gcc ../
to generate the Makefile.
The error message is like:
<dir>/src/test/algorithm.cpp: In function ‘void algo_tests_nonmod()’:
<dir>/src/test/algorithm.cpp:11:20: error: variable ‘b’ set but not used [-Werror=unused-but-set-variable]
constexpr bool b = cx::all_of(std::cbegin(arr), std::cend(arr),
^
<dir>/src/test/algorithm.cpp:18:20: error: variable ‘b’ set but not used [-Werror=unused-but-set-variable]
constexpr bool b = cx::any_of(std::cbegin(arr), std::cend(arr),
^
... (other variable unused error messages) ...
But when I checked the code these variables is used by static_assert
like static_assert(b, "all_of fail");
.
It seems so weird to me since these variables are used in the next line. Could anyone give me some insight or helps for how to go through this issue? (An obvious solution is turning off the -Werror option.)
Thanks.
Hi Jason & Ben!
First I want to start of by saing "Great talk!" (as usual).
I'm prepping a talk for myself on a compile-time lisp interpreter, is it ok to use this project as a basis for my talk?
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.