matt-42 / iod Goto Github PK
View Code? Open in Web Editor NEWMeta programming utilities for C++14. Merged in matt-42/lithium
License: MIT License
Meta programming utilities for C++14. Merged in matt-42/lithium
License: MIT License
cat /etc/issue
Debian GNU/Linux 8 \n \l
Trying to install silicon on my linux server machine.
git clone https://github.com/matt-42/silicon.git
mkdir silicon_build
cd silicon
./install.sh ../silicon_build/
Output:
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is Clang 3.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /root/silicon/silicon_build
Install the project...
-- Install configuration: ""
-- Installing: /root/silicon_build/include/silicon
-- Installing: /root/silicon_build/include/silicon/remote_api.hh
-- Installing: /root/silicon_build/include/silicon/backends
-- Installing: /root/silicon_build/include/silicon/backends/rabbitmq.hh
-- Installing: /root/silicon_build/include/silicon/backends/ws_route.hh
-- Installing: /root/silicon_build/include/silicon/backends/wspp_connection.hh
-- Installing: /root/silicon_build/include/silicon/backends/mimosa.hh
-- Installing: /root/silicon_build/include/silicon/backends/ws_api.hh
-- Installing: /root/silicon_build/include/silicon/backends/mhd.hh
-- Installing: /root/silicon_build/include/silicon/backends/cppnet.hh
-- Installing: /root/silicon_build/include/silicon/backends/h2o.hh
-- Installing: /root/silicon_build/include/silicon/backends/websocketpp.hh
-- Installing: /root/silicon_build/include/silicon/backends/websocketpp_remote_client.hh
-- Installing: /root/silicon_build/include/silicon/backends/urldecode.hh
-- Installing: /root/silicon_build/include/silicon/backends/lwan.hh
-- Installing: /root/silicon_build/include/silicon/middlewares
-- Installing: /root/silicon_build/include/silicon/middlewares/mysql_session.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/mysql_orm.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/mysql_connection.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/sqlite_orm.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/sqlite_types.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/mysql_types.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/tracking_cookie.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/sqlite_connection.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/sqlite_session.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/sql_orm.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/sql_session.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/hashmap_session.hh
-- Installing: /root/silicon_build/include/silicon/middlewares/get_parameters.hh
-- Installing: /root/silicon_build/include/silicon/base_64.hh
-- Installing: /root/silicon_build/include/silicon/sql_rest.hh
-- Installing: /root/silicon_build/include/silicon/utils.hh
-- Installing: /root/silicon_build/include/silicon/blob.hh
-- Installing: /root/silicon_build/include/silicon/hash.hh
-- Installing: /root/silicon_build/include/silicon/clients
-- Installing: /root/silicon_build/include/silicon/clients/templates
-- Installing: /root/silicon_build/include/silicon/clients/templates/javascript_websocket.hh
-- Installing: /root/silicon_build/include/silicon/clients/templates/javascript.hh
-- Installing: /root/silicon_build/include/silicon/clients/javascript_client.hh
-- Installing: /root/silicon_build/include/silicon/clients/libcurl_client.hh
-- Installing: /root/silicon_build/include/silicon/response.hh
-- Installing: /root/silicon_build/include/silicon/procedure_desc.hh
-- Installing: /root/silicon_build/include/silicon/middleware_factories.hh
-- Installing: /root/silicon_build/include/silicon/dynamic_routing_table.hh
-- Installing: /root/silicon_build/include/silicon/api_to_sio.hh
-- Installing: /root/silicon_build/include/silicon/api_description.hh
-- Installing: /root/silicon_build/include/silicon/sql_crud.hh
-- Installing: /root/silicon_build/include/silicon/error.hh
-- Installing: /root/silicon_build/include/silicon/api.hh
-- Installing: /root/silicon_build/include/silicon/http_route.hh
-- Installing: /root/silicon_build/include/silicon/service.hh
-- Installing: /root/silicon_build/include/silicon/di_factories.hh
-- Installing: /root/silicon_build/include/silicon/symbols.hh
-- Installing: /root/silicon_build/include/silicon/file.hh
-- Installing: /root/silicon_build/include/silicon/optional.hh
-- Installing: /root/silicon_build/include/silicon/rmq_route.hh
-- Installing: /root/silicon_build/include/silicon/null.hh
-- Installing: /root/silicon_build/include/silicon
-- Installing: /root/silicon_build/include/silicon/backends
-- Installing: /root/silicon_build/include/silicon/middlewares
-- Installing: /root/silicon_build/include/silicon/clients
-- Installing: /root/silicon_build/include/silicon/clients/templates
Cloning into 'iod'...
remote: Counting objects: 1113, done.
remote: Total 1113 (delta 0), reused 0 (delta 0), pack-reused 1113
Receiving objects: 100% (1113/1113), 360.44 KiB | 0 bytes/s, done.
Resolving deltas: 100% (755/755), done.
Checking connectivity... done.
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is Clang 3.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.55.0
-- Configuring done
-- Generating done
-- Build files have been written to: /root/silicon/silicon_build/externals/iod/silicon_build
Scanning dependencies of target iod_generate_symbols
Scanning dependencies of target apply
Scanning dependencies of target array_view
Scanning dependencies of target aos_view
[ 6%] [ 12%] Building CXX object tools/CMakeFiles/iod_generate_symbols.dir/iod_generate_symbols.cc.o
[ 18%] [ 25%] Building CXX object tests/CMakeFiles/aos_view.dir/aos_view.cc.o
Building CXX object tests/CMakeFiles/apply.dir/apply.cc.o
Building CXX object tests/CMakeFiles/array_view.dir/array_view.cc.o
Linking CXX executable apply
Linking CXX executable array_view
[ 25%] Built target apply
Scanning dependencies of target bind_method
[ 25%] Built target array_view
[ 31%] Building CXX object tests/CMakeFiles/bind_method.dir/bind_method.cc.o
Scanning dependencies of target callable_traits
[ 37%] Building CXX object tests/CMakeFiles/callable_traits.dir/callable_traits.cc.o
Linking CXX executable aos_view
[ 37%] Built target aos_view
Scanning dependencies of target core
[ 43%] Building CXX object tests/CMakeFiles/core.dir/core.cc.o
Linking CXX executable callable_traits
Linking CXX executable bind_method
[ 43%] Built target callable_traits
Scanning dependencies of target deep_merge
[ 43%] [ 50%] Built target bind_method
Building CXX object tests/CMakeFiles/deep_merge.dir/deep_merge.cc.o
Scanning dependencies of target di
[ 56%] Building CXX object tests/CMakeFiles/di.dir/di.cc.o
Linking CXX executable core
[ 56%] Built target core
Scanning dependencies of target foreach
[ 62%] Building CXX object tests/CMakeFiles/foreach.dir/foreach.cc.o
Linking CXX executable iod_generate_symbols
Linking CXX executable di
[ 62%] Built target di
Scanning dependencies of target json
[ 62%] [ 68%] Built target iod_generate_symbols
Building CXX object tests/CMakeFiles/json.dir/json.cc.o
Scanning dependencies of target options
[ 75%] Building CXX object tests/CMakeFiles/options.dir/options.cc.o
Linking CXX executable foreach
[ 75%] Built target foreach
Scanning dependencies of target parse_command_line
[ 81%] Building CXX object tests/CMakeFiles/parse_command_line.dir/parse_command_line.cc.o
Linking CXX executable options
[ 81%] Built target options
Scanning dependencies of target readme
[ 87%] Building CXX object tests/CMakeFiles/readme.dir/readme.cc.o
Linking CXX executable readme
In file included from /root/silicon/silicon_build/externals/iod/tests/deep_merge.cc:4:
In file included from /root/silicon/silicon_build/externals/iod/tests/../iod/json.hh:15:
/root/silicon/silicon_build/externals/iod/tests/../iod/json_unicode.hh:64:61: error: call to implicitly-deleted copy constructor of 'std::basic_stringstream<char>'
wrap_json_input_stream(const iod::stringview& s) { return std::stringstream(s.to_std_string()); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/sstream:502:32: note: copy constructor of 'basic_stringstream<char, std::char_traits<char>, std::allocator<char> >' is implicitly deleted because base class
'basic_iostream<char, std::char_traits<char> >' has a deleted copy constructor
class basic_stringstream : public basic_iostream<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:796:7: note: copy constructor of 'basic_iostream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_istream<char, std::char_traits<char> >' has a deleted copy constructor
: public basic_istream<_CharT, _Traits>,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:58:27: note: copy constructor of 'basic_istream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_ios<char, std::char_traits<char> >' has a deleted copy constructor
class basic_istream : virtual public basic_ios<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/basic_ios.h:66:23: note: copy constructor of 'basic_ios<char, std::char_traits<char> >' is implicitly deleted because base class 'std::ios_base' has an inaccessible
copy constructor
class basic_ios : public ios_base
^
In file included from /root/silicon/silicon_build/externals/iod/tests/deep_merge.cc:4:
In file included from /root/silicon/silicon_build/externals/iod/tests/../iod/json.hh:15:
/root/silicon/silicon_build/externals/iod/tests/../iod/json_unicode.hh:66:57: error: call to implicitly-deleted copy constructor of 'std::basic_stringstream<char>'
wrap_json_input_stream(const std::string& s) { return std::stringstream(s); }
^~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/sstream:502:32: note: copy constructor of 'basic_stringstream<char, std::char_traits<char>, std::allocator<char> >' is implicitly deleted because base class
'basic_iostream<char, std::char_traits<char> >' has a deleted copy constructor
class basic_stringstream : public basic_iostream<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:796:7: note: copy constructor of 'basic_iostream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_istream<char, std::char_traits<char> >' has a deleted copy constructor
: public basic_istream<_CharT, _Traits>,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:58:27: note: copy constructor of 'basic_istream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_ios<char, std::char_traits<char> >' has a deleted copy constructor
class basic_istream : virtual public basic_ios<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/basic_ios.h:66:23: note: copy constructor of 'basic_ios<char, std::char_traits<char> >' is implicitly deleted because base class 'std::ios_base' has an inaccessible
copy constructor
class basic_ios : public ios_base
^
In file included from /root/silicon/silicon_build/externals/iod/tests/deep_merge.cc:4:
In file included from /root/silicon/silicon_build/externals/iod/tests/../iod/json.hh:15:
/root/silicon/silicon_build/externals/iod/tests/../iod/json_unicode.hh:68:50: error: call to implicitly-deleted copy constructor of 'std::basic_stringstream<char>'
wrap_json_input_stream(const char* s) { return std::stringstream(std::string(s)); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/sstream:502:32: note: copy constructor of 'basic_stringstream<char, std::char_traits<char>, std::allocator<char> >' is implicitly deleted because base class
'basic_iostream<char, std::char_traits<char> >' has a deleted copy constructor
class basic_stringstream : public basic_iostream<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:796:7: note: copy constructor of 'basic_iostream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_istream<char, std::char_traits<char> >' has a deleted copy constructor
: public basic_istream<_CharT, _Traits>,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:58:27: note: copy constructor of 'basic_istream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_ios<char, std::char_traits<char> >' has a deleted copy constructor
class basic_istream : virtual public basic_ios<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/basic_ios.h:66:23: note: copy constructor of 'basic_ios<char, std::char_traits<char> >' is implicitly deleted because base class 'std::ios_base' has an inaccessible
copy constructor
class basic_ios : public ios_base
^
[ 87%] Built target readme
Scanning dependencies of target tuple
[ 93%] Building CXX object tests/CMakeFiles/tuple.dir/tuple.cc.o
In file included from /root/silicon/silicon_build/externals/iod/tests/json.cc:7:
In file included from /root/silicon/silicon_build/externals/iod/tests/../iod/json.hh:15:
/root/silicon/silicon_build/externals/iod/tests/../iod/json_unicode.hh:64:61: error: call to implicitly-deleted copy constructor of 'std::basic_stringstream<char>'
wrap_json_input_stream(const iod::stringview& s) { return std::stringstream(s.to_std_string()); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/sstream:502:32: note: copy constructor of 'basic_stringstream<char, std::char_traits<char>, std::allocator<char> >' is implicitly deleted because base class
'basic_iostream<char, std::char_traits<char> >' has a deleted copy constructor
class basic_stringstream : public basic_iostream<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:796:7: note: copy constructor of 'basic_iostream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_istream<char, std::char_traits<char> >' has a deleted copy constructor
: public basic_istream<_CharT, _Traits>,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:58:27: note: copy constructor of 'basic_istream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_ios<char, std::char_traits<char> >' has a deleted copy constructor
class basic_istream : virtual public basic_ios<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/basic_ios.h:66:23: note: copy constructor of 'basic_ios<char, std::char_traits<char> >' is implicitly deleted because base class 'std::ios_base' has an inaccessible
copy constructor
class basic_ios : public ios_base
^
In file included from /root/silicon/silicon_build/externals/iod/tests/json.cc:7:
In file included from /root/silicon/silicon_build/externals/iod/tests/../iod/json.hh:15:
/root/silicon/silicon_build/externals/iod/tests/../iod/json_unicode.hh:66:57: error: call to implicitly-deleted copy constructor of 'std::basic_stringstream<char>'
wrap_json_input_stream(const std::string& s) { return std::stringstream(s); }
^~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/sstream:502:32: note: copy constructor of 'basic_stringstream<char, std::char_traits<char>, std::allocator<char> >' is implicitly deleted because base class
'basic_iostream<char, std::char_traits<char> >' has a deleted copy constructor
class basic_stringstream : public basic_iostream<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:796:7: note: copy constructor of 'basic_iostream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_istream<char, std::char_traits<char> >' has a deleted copy constructor
: public basic_istream<_CharT, _Traits>,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:58:27: note: copy constructor of 'basic_istream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_ios<char, std::char_traits<char> >' has a deleted copy constructor
class basic_istream : virtual public basic_ios<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/basic_ios.h:66:23: note: copy constructor of 'basic_ios<char, std::char_traits<char> >' is implicitly deleted because base class 'std::ios_base' has an inaccessible
copy constructor
class basic_ios : public ios_base
^
In file included from /root/silicon/silicon_build/externals/iod/tests/json.cc:7:
In file included from /root/silicon/silicon_build/externals/iod/tests/../iod/json.hh:15:
/root/silicon/silicon_build/externals/iod/tests/../iod/json_unicode.hh:68:50: error: call to implicitly-deleted copy constructor of 'std::basic_stringstream<char>'
wrap_json_input_stream(const char* s) { return std::stringstream(std::string(s)); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/sstream:502:32: note: copy constructor of 'basic_stringstream<char, std::char_traits<char>, std::allocator<char> >' is implicitly deleted because base class
'basic_iostream<char, std::char_traits<char> >' has a deleted copy constructor
class basic_stringstream : public basic_iostream<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:796:7: note: copy constructor of 'basic_iostream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_istream<char, std::char_traits<char> >' has a deleted copy constructor
: public basic_istream<_CharT, _Traits>,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/istream:58:27: note: copy constructor of 'basic_istream<char, std::char_traits<char> >' is implicitly deleted because base class
'basic_ios<char, std::char_traits<char> >' has a deleted copy constructor
class basic_istream : virtual public basic_ios<_CharT, _Traits>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/basic_ios.h:66:23: note: copy constructor of 'basic_ios<char, std::char_traits<char> >' is implicitly deleted because base class 'std::ios_base' has an inaccessible
copy constructor
class basic_ios : public ios_base
^
3 errors generated.
tests/CMakeFiles/deep_merge.dir/build.make:54: recipe for target 'tests/CMakeFiles/deep_merge.dir/deep_merge.cc.o' failed
make[2]: *** [tests/CMakeFiles/deep_merge.dir/deep_merge.cc.o] Error 1
CMakeFiles/Makefile2:363: recipe for target 'tests/CMakeFiles/deep_merge.dir/all' failed
make[1]: *** [tests/CMakeFiles/deep_merge.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX executable tuple
[ 93%] Built target tuple
3 errors generated.
tests/CMakeFiles/json.dir/build.make:54: recipe for target 'tests/CMakeFiles/json.dir/json.cc.o' failed
make[2]: *** [tests/CMakeFiles/json.dir/json.cc.o] Error 1
CMakeFiles/Makefile2:468: recipe for target 'tests/CMakeFiles/json.dir/all' failed
make[1]: *** [tests/CMakeFiles/json.dir/all] Error 2
Linking CXX executable parse_command_line
[ 93%] Built target parse_command_line
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2
Cannot install /root/silicon_build.
I successfully installed one if previous versions of silicon and iod on the same machine with the same OS before. What I am doing wrong?
I tried to compile this with VS2015 Update 1 and, lo and behold, it failed to compile. The first place it fell over is the line below, with enable_if_t
:
https://github.com/matt-42/iod/blob/master/iod/grammar.hh#L97
decltype(auto) exp_transform_iterate(E& exp, F map,
C ctx,
std::enable_if_t<!callable_with<F, E&, C>::value and
!has_transform_iterate<E>::value>* = 0)
I'm just diving back into C++ after several years away, so this syntax is quite foreign. Specifically, MSVC fails at the and
(expecting >
). Is this a specific C++14 feature that VS2015 hasn't implemented? I took a look a brief look at SFINAE and enable_if_t
but couldn't find any relevant compatibility shortcoming in the following table:
http://en.cppreference.com/w/cpp/compiler_support
Any help to get my bearings on what is happening here would be greatly appreciated (as I'm not actually expecting MSVC support).
It’s a work in progress but I thought you might be interested:
https://github.com/fish2000/iod-symbolizer/
… I wrote it to e.g.: conditionally extract all symbols from .hpp/.hh/.cpp/.cc/.mm files in directories {aa/src, bb/src, aa/include, bb/include} – originally for one project but now I have spun it off. Written in Python, runs quick enough to use it as a CMake target 💯
Salud – thanks again for releasing your work
-Alex
Hello, how I can define _new symbol?
Centos 7, clang5
$ cmake ..
-- The C compiler identification is Clang 5.0.1
-- The CXX compiler identification is Clang 5.0.1
-- Check for working C compiler: /usr/local/bin/clang
-- Check for working C compiler: /usr/local/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/bin/clang++
-- Check for working CXX compiler: /usr/local/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Boost version: 1.53.0
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/data/Soft/clang/iod/ff
$ cmake --build .
Scanning dependencies of target iod_generate_symbols
[ 3%] Building CXX object tools/CMakeFiles/iod_generate_symbols.dir/iod_generate_symbols.cc.o
[ 6%] Linking CXX executable iod_generate_symbols
[ 6%] Built target iod_generate_symbols
Scanning dependencies of target parse_command_line
[ 9%] Building CXX object tests/CMakeFiles/parse_command_line.dir/parse_command_line.cc.o
In file included from /opt/data/Soft/clang/iod/tests/parse_command_line.cc:10:
In file included from /opt/data/Soft/clang/iod/tests/symbols.hh:2:
In file included from /opt/data/Soft/clang/iod/tests/../iod/symbol.hh:5:
In file included from /opt/data/Soft/clang/iod/tests/../iod/grammar.hh:6:
In file included from /opt/data/Soft/clang/iod/tests/../iod/foreach.hh:4:
In file included from /opt/data/Soft/clang/iod/tests/../iod/callable_traits.hh:3:
In file included from /opt/data/Soft/clang/iod/tests/../iod/typelist.hh:4:
/opt/data/Soft/clang/iod/tests/../iod/tuple_utils.hh:48:41: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
decltype(auto) arg_get_by_type_( std::enable_if_t<!std::is_same<E,
~~~~~^~~~~~~~~~~
enable_if
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1766:12: note: 'enable_if' declared here
struct enable_if
^
In file included from /opt/data/Soft/clang/iod/tests/parse_command_line.cc:10:
In file included from /opt/data/Soft/clang/iod/tests/symbols.hh:2:
In file included from /opt/data/Soft/clang/iod/tests/../iod/symbol.hh:5:
In file included from /opt/data/Soft/clang/iod/tests/../iod/grammar.hh:6:
In file included from /opt/data/Soft/clang/iod/tests/../iod/foreach.hh:4:
In file included from /opt/data/Soft/clang/iod/tests/../iod/callable_traits.hh:3:
In file included from /opt/data/Soft/clang/iod/tests/../iod/typelist.hh:4:
/opt/data/Soft/clang/iod/tests/../iod/tuple_utils.hh:49:41: error: no template named 'decay_t' in namespace 'std'; did you mean 'decay'?
std::decay_t>::value>*,
~~~~~^~~~~~~
decay
How can i fix it?
This method has two bugs:
If t == 0
, the while
never executes, thus the integer zero is encoded as an empty string.
If t < 0
, t % 10
will yield negative values, encoding the numbers incorrectly.
I could make a PR with a possible fix. Is that ok?
Now, all iod_define_attribute objects in global namespace:
namespace { NAME##_attribute_name<0> NAME; }
So compiler throw error if I make my own class with the same name.
I don't know is it possible, but it would be nice to move them to some namespace.
json_string s{"""};
json_encode( s ); // got unescaped "
Actually noted in Silicon: json_encode'ing some D object with string containing quotes returns invalid JSON.
Hi, is it possible to parse command line options like --my-switch for example? I had a look at the code and I think the answer is no, but maybe I missed something? Or is there a workaround?
Can symbol's attributes value be lambda or std::bind objects? like:
_id(_some_handle=[]() { ... }
and can we access the sio(or symbol) within the lambda? like:
_id(_some_handle=[this]() { ... }
thanks!
It's been two years since release 1.0 and I see here matt-42/silicon@2894f06 that there is a new version for iod.
Could you provide/update repo tags?
With GCC 4.9.3 (debian linux) I get compilation errors related to the lack of copy constructor in std::stringstream
:
Scanning dependencies of target di
In file included from /home/manuel-sanchez/Documentos/iod/tests/../iod/json.hh:15:0,
from /home/manuel-sanchez/Documentos/iod/tests/deep_merge.cc:4:
/home/manuel-sanchez/Documentos/iod/tests/../iod/json_unicode.hh: In function ‘decltype(auto) iod::wrap_json_input_stream(const iod::stringview&)’:
/home/manuel-sanchez/Documentos/iod/tests/../iod/json_unicode.hh:64:96: error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&)’
wrap_json_input_stream(const iod::stringview& s) { return std::stringstream(s.to_std_string()); }
^
In file included from /home/manuel-sanchez/Documentos/iod/tests/../iod/json.hh:9:0,
from /home/manuel-sanchez/Documentos/iod/tests/deep_merge.cc:4:
/usr/include/c++/4.9/sstream:502:11: note: ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_stringstream : public basic_iostream<_CharT, _Traits>
^
/usr/include/c++/4.9/sstream:502:11: error: use of deleted function ‘std::basic_iostream<char>::basic_iostream(const std::basic_iostream<char>&)’
In file included from /usr/include/c++/4.9/iostream:40:0,
from /home/manuel-sanchez/Documentos/iod/tests/deep_merge.cc:1:
/usr/include/c++/4.9/istream:795:11: note: ‘std::basic_iostream<char>::basic_iostream(const std::basic_iostream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_iostream
^
What I can say from the output is that it seems that for some reason that function is not triggering RVO and the stdlibc++ stream has no move constructor (So the compiler picks the copy ctor instead).
UPDATE: After adding gcc 4.9 to the build matrix I see that the "issue" is just that the library no longer supports GCC 4.9 in its current form.
Do you have plans to maintain compatibility with GCC 4.9?
I removed it and everything seems fine.
I think this is easier and more readable to use :
auto person = iod(
name = "Philippe"
);
Is there a reason for the added underscore in the definitions?
I'm getting the following error when trying to call iod_to_json()
function:
g++ -o example example.cc -std=c++11
In file included from example.cc:4:
./iod_json.hh:108:5: error: call to 'iod_attr_to_json' is ambiguous
iod_attr_to_json(*static_cast<const iod_object<Tail...>*>(&o), ss);
^~~~~~~~~~~~~~~~
./iod_json.hh:108:5: note: in instantiation of function template specialization 'iod_internals::iod_attr_to_json<cities_attr<std::initializer_list<const char *> >,
cars_attr<std::initializer_list<iod_object<name_attr<const char *>, model_attr<const char *>, xxx_attr<int> > > > >' requested here
iod_attr_to_json(*static_cast<const iod_object<Tail...>*>(&o), ss);
^
./iod_json.hh:108:5: note: in instantiation of function template specialization 'iod_internals::iod_attr_to_json<age_attr<int>, cities_attr<std::initializer_list<const char *> >,
cars_attr<std::initializer_list<iod_object<name_attr<const char *>, model_attr<const char *>, xxx_attr<int> > > > >' requested here
iod_attr_to_json(*static_cast<const iod_object<Tail...>*>(&o), ss);
^
./iod_json.hh:108:5: note: in instantiation of function template specialization 'iod_internals::iod_attr_to_json<name_attr<const char *>, age_attr<int>,
cities_attr<std::initializer_list<const char *> >, cars_attr<std::initializer_list<iod_object<name_attr<const char *>, model_attr<const char *>, xxx_attr<int> > > > >'
requested here
iod_attr_to_json(*static_cast<const iod_object<Tail...>*>(&o), ss);
^
./iod_json.hh:81:5: note: in instantiation of function template specialization 'iod_internals::iod_attr_to_json<xxx_attr<std::initializer_list<const char *> >, name_attr<const char
*>, age_attr<int>, cities_attr<std::initializer_list<const char *> >, cars_attr<std::initializer_list<iod_object<name_attr<const char *>, model_attr<const char *>,
xxx_attr<int> > > > >' requested here
iod_attr_to_json(o, ss);
^
./iod_json.hh:89:5: note: in instantiation of function template specialization 'iod_internals::iod_to_json<xxx_attr<std::initializer_list<const char *> >, name_attr<const char *>,
age_attr<int>, cities_attr<std::initializer_list<const char *> >, cars_attr<std::initializer_list<iod_object<name_attr<const char *>, model_attr<const char *>, xxx_attr<int> >
> > >' requested here
iod_to_json(o, ss);
^
./iod_json.hh:322:25: note: in instantiation of function template specialization 'iod_internals::iod_to_json<xxx_attr<std::initializer_list<const char *> >, name_attr<const char *>,
age_attr<int>, cities_attr<std::initializer_list<const char *> >, cars_attr<std::initializer_list<iod_object<name_attr<const char *>, model_attr<const char *>, xxx_attr<int> >
> > >' requested here
return iod_internals::iod_to_json(o);
^
example.cc:35:22: note: in instantiation of function template specialization 'iod_to_json<xxx_attr<std::initializer_list<const char *> >, name_attr<const char *>, age_attr<int>,
cities_attr<std::initializer_list<const char *> >, cars_attr<std::initializer_list<iod_object<name_attr<const char *>, model_attr<const char *>, xxx_attr<int> > > > >'
requested here
std::string json = iod_to_json(person);
^
./iod_json.hh:94:8: note: candidate function [with T = cars_attr<std::initializer_list<iod_object<name_attr<const char *>, model_attr<const char *>, xxx_attr<int> > > >]
void iod_attr_to_json(const iod_object<T>& o, std::stringstream& ss)
^
./iod_json.hh:102:8: note: candidate function [with T = cars_attr<std::initializer_list<iod_object<name_attr<const char *>, model_attr<const char *>, xxx_attr<int> > > >, Tail = <>]
void iod_attr_to_json(const iod_object<T, Tail...>& o, std::stringstream& ss)
^
1 error generated.
Just to know, I'm using MacOS + clang (Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn))
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.