Last active
September 7, 2018 08:55
-
-
Save carmel4a/6558ffef4c2e845d1b94251c12575967 to your computer and use it in GitHub Desktop.
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 <iostream> | |
namespace ModuleA | |
{ | |
struct Config | |
{ | |
static unsigned char ( * get_next_byte_function)(void); | |
}; | |
unsigned char (*Config::get_next_byte_function)(void) | |
= []()-> unsigned char{ return '\0';}; | |
} | |
//// Other src file //// | |
namespace ModuleB | |
{ | |
struct Config | |
{ | |
static unsigned char (* get_next_byte_function)(void); | |
}; | |
unsigned char (*Config::get_next_byte_function)(void) | |
= []()-> unsigned char{ return '\0';}; | |
} | |
//// Other src file //// | |
namespace ModuleUtilities | |
{ | |
unsigned char get_next_byte() | |
{ | |
std::cout << "3"; | |
return '3'; | |
}; | |
} | |
/// Main/Logic file /// | |
int main() | |
{ | |
ModuleA::Config::get_next_byte_function = &ModuleUtilities::get_next_byte; | |
ModuleB::Config::get_next_byte_function = &ModuleUtilities::get_next_byte; | |
ModuleB::Config::get_next_byte_function(); | |
ModuleB::Config::get_next_byte_function(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment