Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct vector[T]{
- private{
- // do not touch my privates
- field data:[]ptr T;
- field size:uword;
- field capacity:uword;
- }
- function new():vector[T]{
- return vector[T]{
- data = null,
- size = 0,
- capacity = 0
- };
- }
- }
- vector[i32].new() // fine
- vector[i32]{data = null, size = 1, capacity = 1} // fail - visibility mismatch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement