-
Notifications
You must be signed in to change notification settings - Fork 269
-
Sorry this is a newbie question, but what is the correct way of splitting a project across multiple .cpp2 files?
Say I have this code
main: () =
{
Hello();
}
Hello : () =
{
std::cout << "Hello World";
}
And want to move the definition of Hello into a different file?
Beta Was this translation helpful? Give feedback.
All reactions
-
👀 1
Replies: 1 comment 4 replies
-
I think this is a subject of #594.
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes I read that one, but it seems more about using headers to work alongside cpp code. What do I do in a pure ccp2 project?
Beta Was this translation helpful? Give feedback.
All reactions
-
You still need Cpp2 headers, unless you're OK with forward-declaring Hello in Cpp1.
Beta Was this translation helpful? Give feedback.
All reactions
-
I think for pure cpp2 projects we should push towards using modules exclusively, but cppfront doesn't support that (yet) #269
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 2
-
I'm doing a multiple-cpp2 project right now and using Johel's modules version of cppfront. It's working pretty well. https://github.com/threeifbyair/advent2024
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1 -
👀 1