Hi , what is the difference between these 2 vector assignments :
vector myVect = set(1,2,3);
vector myVect = {1,2,3};
Thanks
vex - vector set()
2726 3 2- metaclay2
- Member
- 48 posts
- Joined: Feb. 2013
- Offline
- matthias_k
- Member
- 483 posts
- Joined: Dec. 2006
- Offline
- metaclay2
- Member
- 48 posts
- Joined: Feb. 2013
- Offline
- BabaJ
- Member
- 2038 posts
- Joined: Sept. 2015
- Offline
It's neither by design or a bug.
Perhaps you could say it is ‘by design’ indirectly;
The curly braces are not a “function” - they are simply part of a syntax structure that we can use in certain contexts, in this case along with the combination of = , and ; characters that allow us to assign values to ‘myVec’.
There's nothing to tell the compiler what foo is or how it should be handled, to do that, we need a simple function;
like say - the set() function, that can handle what foo is.
All you more knowledgeable people out there - please do chime and correct me or rephrase/add to what I've said if wrong.
Perhaps you could say it is ‘by design’ indirectly;
The curly braces are not a “function” - they are simply part of a syntax structure that we can use in certain contexts, in this case along with the combination of = , and ; characters that allow us to assign values to ‘myVec’.
There's nothing to tell the compiler what foo is or how it should be handled, to do that, we need a simple function;
like say - the set() function, that can handle what foo is.
All you more knowledgeable people out there - please do chime and correct me or rephrase/add to what I've said if wrong.
Edited by BabaJ - April 21, 2018 19:42:54
-
- Quick Links