Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module test;
- void main()
- {
- struct Data
- {
- int id;
- }
- import std.container.array : Array;
- Array!Data gallery;
- Data d1;
- gallery.insertBack(d1);
- auto d2 = gallery[0];
- d2.id = 1;
- assert(d2.id == gallery[0].id, "neither ref nor pointer");
- }
Add Comment
Please, Sign In to add comment