Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is possible to store either structs or pointer to structs ? #25

Open
estebanzimanyi opened this issue Jun 11, 2023 · 1 comment
Open

Comments

@estebanzimanyi
Copy link

In STL it is possible to define, e.g.,

vector<SweepEvent> ev;
vector<SweepEvent*> evp;

After looking in the documentation, the code, and the examples I was not able to determine whether this can be done in CTL.
Thanks for your answer.
Esteban

@Junming-Liang
Copy link

Junming-Liang commented Aug 17, 2023

I, too, have entertained similar contemplations. You can encapsulate pointers within the struct to achieve the sought-after effect.

typedef struct SweepEventPoint{ SweepEvent *point};
 #define POD
 #define NOT_INTEGRAL
 #define T SweepEventPoint
 #include "ctl/vector.h"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants