When specifying the whole flag list in one go, do a compile time check using the template parameters. When modifying a runtime-written flag list, do a runtime check on the final flag variables using the function parameters.