If you are committed to using Visual Studio and C ++, then people can advise you to abandon this restriction ("do not write in C ++, make it an HTML5 web page, and it can work anywhere, even on the iPhone!"). Or they may indicate why your question is not being answered. or , they can correctly answer your question (what is the concept !: -P)
If you use SDL, then the answer will be "you can get closer to your desire, up to the last step, kind of." The ability to write a game program in one code base, and then take that code base to various machines and compile it and make it work - this is exactly what the Simple DirectMedia Library was designed to do! It would not be very popular if it would not make it a reasonable target.
This does not mean that you can click the button and display the Macintosh or Linux binary package from Visual Studio. But you can always find friends and ask them to try compilation for you on a code base. As long as you were careful to call functions only from the standard C ++ library and stay inside the box that the SDL gives, it should compile ... theoretically.
"In theory, there is no difference between theory and practice. In practice, there is." - YogiBerra
In C ++, it can be harder than in other languages to make sure you are in the "sandbox for portability" (especially if you're a beginner). And it can be harder if you follow tutorials that focus on Microsoft tools, especially since they have little doubt that you are advised to make Windows-only calls in their documentation. Thus, the likelihood that you will be able to pass the "fully debugged" code to a friend, compile it and work on the new platform for the first time will be low.
Of course, you will need a testing period. And you probably shouldn't wait until the last minute for anyone else to make sure that the basics work by compiling them in Xcode or something else. You can reduce the risk of writing non-portable code by using the GCC compiler instead, which is more likely to complain if you start creating dependencies that are not really cross platform.
It may also be possible to run the Hackintosh virtual machine if you enjoy living on the edge. Of course, you can create a Linux virtual machine and try to build it under it, and if it works, it will increase the confidence that the Mac build will work. However, this does not guarantee.