@Kiril Kirov's answer is correct, it depends mostly on compiler availability, but some other elements are at stake.
The compiler is responsible for transforming C++ code to machine code in the native instruction set.
It also relies on the c++ standard library which obviously needs to be compilable for your system using said compiler.
Note that after this operation the produced code is not essentially different from other native code produced by other means (using a C compiler or written by hand), so there's no reason it wouldn't be executed by your microprocessor.
You also need a linker which knows the memory layout of the target microcontroller (processor+RAM+flash memory or ROM).
You also need a way to flash the code to your system, such as USB link and drivers.
In arduino's case, you can find all these elements readily available because it is a known platform (Arduino runs on AVR or ARM depending on the version, so possible compilers would be respectively avr-gcc
or arm-none-eabi-gcc
), but in more exotic cases it isn't a given (chances are that you cannot flash your Mastercard).