You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UPDATE:
I have a basic (simple?) problem: how can I include a cpp2 header with class definition in two .cpp2 files and link them together. I will get 'multiple definition' error on linking.
The text was updated successfully, but these errors were encountered:
Cpp2 function bodies are order independent.
So their relative order in a source file doesn't matter.
The README mentions:
An alternative syntax would let us do things we can never do within today's syntax without breaking the world:
[...]
make it easy to write refactoring and other tools (e.g., have order-independent semantics).
UPDATE: I have a basic (simple?) problem: how can I include a cpp2 header with class definition in two .cpp2 files and link them together. I will get 'multiple definition' error on linking.
This problem was brought to light by the discussion at #594.
I found that cppfront requires class function to be defined in declaration. (https://github.com/hsutter/cppfront/blob/main/source/sema.h#L1076)
In c++ definition and declaration are more independent.
I wonder why this constrain exists?
UPDATE:
I have a basic (simple?) problem: how can I include a cpp2 header with class definition in two .cpp2 files and link them together. I will get 'multiple definition' error on linking.
The text was updated successfully, but these errors were encountered: