what would C++ look like for a logic gate?