Posts

Showing posts from August 8, 2018

Is it legal to use a paper and a pen during Android: Netrunner play?

Image
Clash Royale CLAN TAG #URR8PPP up vote 1 down vote favorite Can one make writings or log during the Android: Netrunner play? Or every player should use only its own memory? android-netrunner share | improve this question asked 2 days ago Denis Gladkiy 376 1 2 12 add a comment  |  up vote 1 down vote favorite Can one make writings or log during the Android: Netrunner play? Or every player should use only its own memory? android-netrunner share | improve this question asked 2 days ago Denis Gladkiy 376 1 2 12 add a comment  |  up vote 1 down vote favorite up vote 1 down vote favorite Can one make writings or log during the Android: Netrunner play? Or every player should use only its own memory? android-netrunner share | improve this question asked 2 days ago Denis Gladkiy 376 1 2 12 Can one make writings or log during the Android: Netrunner play? O

FlagSet with C++ templates

Image
Clash Royale CLAN TAG #URR8PPP .everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0; up vote 10 down vote favorite 1 I am creating a C++ header-only library for FlagSet. A FlagSet is a container for booleans with meaning. Usually, it is done with constants (macro, enums, whatever), for example : //from SDL2 #define SDL_INIT_AUDIO 0x00000010u #define SDL_INIT_VIDEO 0x00000020u #define SDL_INIT_EVENTS 0X00000040u ... Uint32 flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO; if ((flags & SDL_INIT_VIDEO)) /* video implies events */ flags It is not as safe as a scoped enum ( enum class ), you can mix up flags from one meaning to another (for example, it is possible to do SDL_INIT_AUDIO | SDL_WINDOW_RESIZABLE even if they do not share any logic). The aim of my FlagSet library is to provide a "scoped flags" (by analogy with scoped enum). Here is my code : #include <iostream> #include <cstddef> #include <type_traits>