I want to make sure resource image files that I pass to my gui are actually there during compile time. something like
load_image(static_assert(!(std::filesystem::exists(pathToFile)), "Resource file " + std::string(pathToFile) + " does not exist"));
This seems to require std::filesystem::path to be constexpr. Is this possible or can I only do this through build tools?
The goal of this would be to catch simple mistakes at compile time before it leaves our desks and goes through the QA process.
A number of people pointed out that the files may have moved on the users system after distribution. this is both untrue and misses the point. It's an arcade game. we have full control over the whole system. the program and resources get baked into an OS and the user has no access to files to move anything. It misses the point by assuming I'm relying on this to prevent run time errors. I am not. I am attempting to prevent one type of error as early as possible. it is not meant to be the only way in which we attempt to prevent errors.