This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <map> | |
#include <functional> | |
template <template <typename...> class kv_map_t, typename...> struct memoizer; | |
template <template <typename...> class kv_map_t, typename ret_t, typename... args_t, typename... kv_param_t> | |
struct memoizer<kv_map_t, ret_t, std::tuple<args_t...>, kv_param_t...> { | |
memoizer(std::function<ret_t(args_t...)> const& func):func_(func) {} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://cpptruths.blogspot.com/2012/01/general-purpose-automatic-memoization.html | |
#include <map> | |
#include <functional> | |
#include <iostream> | |
#include <boost/preprocessor/variadic/size.hpp> | |
#include <boost/preprocessor/comparison/equal.hpp> | |
#include <boost/preprocessor/control/iif.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://cpptruths.blogspot.com/2012/01/general-purpose-automatic-memoization.html | |
#include <map> | |
#include <functional> | |
#include <iostream> | |
#include <memory> | |
#include <boost/preprocessor/variadic/size.hpp> | |
#include <boost/preprocessor/comparison/equal.hpp> | |
#include <boost/preprocessor/control/iif.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <msgpack.hpp> | |
int main(int argc, char **argv) | |
{ | |
// Build a buffer containing a sample msgpack-rpc message | |
msgpack::sbuffer sbuf; | |
msgpack::packer<msgpack::sbuffer> packer(&sbuf); | |
packer.pack_array(4); | |
packer.pack(0); | |
packer.pack(123456); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------- | |
[kondo@alarmpi] $ gcc -v | |
Using built-in specs. | |
COLLECT_GCC=gcc | |
COLLECT_LTO_WRAPPER=/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.9.0/lto-wrapper | |
Target: armv6l-unknown-linux-gnueabihf | |
Configured with: ../gcc/configure --prefix=/home/kondo/local --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --enable-libstdcxx-time --enable-gnu-unique-object --enable-linker-build-id --with-ppl --enable-cloog-backend=isl --disable-ppl-version-check --disable-cloog-version-check --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu --disable-multilib --disable-libssp --disable-build-with-cxx --disable-build-poststage1-with-cxx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a - elf/aeabi_unwind_cpp_pr1.os | |
a - elf/find_exidx.os | |
armv6l-raspi-linux-gnueabihf-gcc -nostdlib -nostartfiles -r -o /home/kondo/work/raspi-tools/raspi-glibc-stage1/src/glibc-build/elf/librtld.map.o '-Wl,-(' /home/kondo | |
/work/raspi-tools/raspi-glibc-stage1/src/glibc-build/elf/dl-allobjs.os /home/kondo/work/raspi-tools/raspi-glibc-stage1/src/glibc-build/libc_pic.a -lgcc '-Wl,-)' -Wl,-M | |
ap,/home/kondo/work/raspi-tools/raspi-glibc-stage1/src/glibc-build/elf/librtld.mapT | |
/usr/bin/armv6l-raspi-linux-gnueabihf-ld: -lgcc が見つかりません | |
collect2: error: ld returned 1 exit status | |
Makefile:296: recipe for target '/home/kondo/work/raspi-tools/raspi-glibc-stage1/src/glibc-build/elf/librtld.map' failed | |
make[2]: *** [/home/kondo/work/raspi-tools/raspi-glibc-stage1/src/glibc-build/elf/librtld.map] Error 1 | |
make[2]: Leaving directory '/home/kondo/work/raspi-tools/raspi-glibc-stage1/src/glibc-2.17/elf' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <msgpack.h> | |
#include <assert.h> | |
int main(int argc, char **argv) | |
{ | |
int64_t test_i64 = 0xFFF7FFFFFFFFFFFFLL; | |
msgpack_sbuffer buf; | |
msgpack_sbuffer_init(&buf); | |
msgpack_packer * pk = msgpack_packer_new(&buf, msgpack_sbuffer_write); | |
msgpack_pack_array(pk, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <iostream> | |
#include <boost/range/any_range.hpp> | |
#include <boost/range/adaptor/sliced.hpp> | |
typedef boost::any_range<int, boost::random_access_traversal_tag, int, std::ptrdiff_t> int_range; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/iterator/iterator_facade.hpp> | |
struct my_iter:boost::iterator_facade<my_iter, int, boost::random_access_traversal_tag, int&> {}; | |
struct my_iter_noref:boost::iterator_facade<my_iter, int, boost::random_access_traversal_tag, int> {}; | |
int main() { | |
// has reference | |
static_assert( | |
std::is_convertible< | |
std::iterator_traits<my_iter>::iterator_category, | |
std::random_access_iterator_tag |
OlderNewer