on-internet
← Community

Is it possible to declare constexpr or template function in a module .cppm file and define it in a separate .cpp file? For uniform code organization

Stack Overflow ·

This question would an "update" about this kind of topics, like this old question: Is it possible to declare constexpr class in a header and define it in a separate .cpp file?, but now with C++ modules, in the context about functions that are called from multiple files and not only called from the same file. About functions that with a traditional file structure, .h/header and .cpp files, need to be placed entirely in the header file: constexpr functions template functions Now with C++ modules: Are there changes about it? Is it possible to split the function declaration and the function defini

Comments

Sign in or sign up to comment and upvote.

No comments yet.