online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <iostream> #include <bitset> #include <limits> struct Port { constexpr Port(int value): btn(value) { } const int btn; } ; template<auto& ...args> struct Pack { static constexpr size_t size = (sizeof...(args)) ; static constexpr auto value = ((1 << args.btn) | ...) ; constexpr static std::size_t GetOnesCount(size_t val) { auto count = 0; auto n = val ; for ( ; n != 0; count++) { n &= (n - 1); } return count ; } static constexpr bool unique = (size == GetOnesCount(value)) ; } ; constexpr Port P00{0} ; constexpr Port P01{1} ; constexpr Port P02{2} ; constexpr Port P03{3} ; constexpr Port P04{4} ; constexpr Port P05{5} ; constexpr Port P06{6} ; constexpr Port P07{7} ; using PortLits = Pack<P00, P01,P01,P04,P05,P06,P07> ; //static_assert(PortLits::unique, "Беда, пины не разные") ; int main() { std::cout << PortLits::unique ; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue