The code example in approach 2 looks ill-formed though. If you change line 12 to auto to let compiler deduce the return type, you will see error message "explicit specialization of 'clock_impl' after instantiation".
I am a software engineer that passionate about problem-solving and continuous learning. Have constantly been participating in competitive programming using C++ since high school.
ref: https://stackoverflow.com/questions/36997351/using-a-templat...
So not very sure how to elegantly inject our mock into the main code via the test section.