This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
is that possible?
- From: Leonardo <sombriks at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 6 Sep 2011 10:23:34 -0300
- Subject: is that possible?
hello all,
is the construction bellow valid in ansi C?
test("a",1)("b",2)("c",3);
Using some pointer-to-function magic i managed to get the form bellow,
but not the above one:
typedef void (test_fn)(char*, int);
test_fn *test(char *str,int len){
/*...*/
}
test("a",1)("b",2);
Thanks in advance.
ps: i just want to know if such idiom could be valid, i'm aware of
fluent interfaces[1], i'm just want to know what i am missing of if
its indeed impossible.
[1]http://en.wikipedia.org/wiki/Fluent_interface