Norman Jonas
2002-12-29 02:44:21 UTC
Since the several years I develop in c++ there is nothing I missed more than
the "with"
keyword as it is known by languages like Pascal. So I would like to know
what gcc
developer / user think of the idea to advance the c++ standard to add it.
Pro:
Very useful for many c++ developer
Slightly reduces code size / code to write
Contra:
Needs time until compiler developing companies implement it
To give an example of what I think the with keyword should be used :
struct S
{
int x;
int y;
};
int main()
{
S s;
with (s)
{
.x = 1;
.y = 2;
}
return 0;
}
and / or
class C
{
public:
void init ();
void next ();
}
int main()
{
C c;
with (c)
{
.init();
.next();
}
return 0;
}
This technique could be used in conjunction with structs as well as classes.
If there is enough reason to add this keyword to the c++ standard maybe the
ANSI consortium could be asked to add the "with" keyword to a new revision
of their c++ draft.
Norman Jonas
the "with"
keyword as it is known by languages like Pascal. So I would like to know
what gcc
developer / user think of the idea to advance the c++ standard to add it.
Pro:
Very useful for many c++ developer
Slightly reduces code size / code to write
Contra:
Needs time until compiler developing companies implement it
To give an example of what I think the with keyword should be used :
struct S
{
int x;
int y;
};
int main()
{
S s;
with (s)
{
.x = 1;
.y = 2;
}
return 0;
}
and / or
class C
{
public:
void init ();
void next ();
}
int main()
{
C c;
with (c)
{
.init();
.next();
}
return 0;
}
This technique could be used in conjunction with structs as well as classes.
If there is enough reason to add this keyword to the c++ standard maybe the
ANSI consortium could be asked to add the "with" keyword to a new revision
of their c++ draft.
Norman Jonas