/******************************************************************************
Online C++ Compiler: Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <cstdint>
enum Switch : uint8_t {C1V1= 5, C1V2, C2V1, C2V2, C2V3, D3V3, };
enum Railway: uint8_t {G1D= 22, A1G, A1D, A2G, A2D, A3G, A3D, A4G, A4D, };
const uint8_t max_handled_railways_per_switch= 4;
struct Railways_switch {
Switch button;
Railway ways[max_handled_railways_per_switch];
};
const Railways_switch rs_map [] {
{C1V1, {G1D, A1G, A3D}},
{C2V1, {A1G, A1D, A3D, A4D}},
{C2V3, {A2D, A3G}},
};
int main()
{
for (const auto& rs: rs_map) {
std::cout<< "boutton: "<< rs.button << '\n';
for (const auto& way: rs.ways)
if (way)
std::cout<< " voie: "<< way<< '\n';
}
}