Is it a good idea to use #include "randombytes.cpp"
instead of randombytes.h
in my project (where randombytes.cpp
is a file in my projects source code directory) for runtime speed reasons? randombytes.cpp
would look like this:
#ifndef RANDOMBYTES_INCLUDED
#define RANDOMBYTES_INCLUDED
/* include native headers here */
unsigned char *fetch_random_bytes(int amount);
/* include other parts of my project here if necessary */
unsigned char *fetch_random_bytes(int amount) {
// do stuff
}
#endif
This should also work for files requiring each other and so on, right? Can you think of any cases in which this won't work or I won't get the optimization benefit?