
HI all, God only knows what else can be found inside this compiler if one is willing to dig real deep. For example, Igor' Chesnokov from RSDN (Russian Software Development Network) has found a way to implement typeof() that does not require registration, and probably has compile-time performance of a native typeof. How? Apparently, some weird "feature" of Visual C++ allowed him to twick a template body at the moment of instantiation, when additional context is available, thus "registering" classes on the fly, at the moment of taking typeof(). Microsoft-specific "bugfeatures" are generally not in the area of my interests. However I do realize that, on the Microsoft compiler, this might look much more attractive then anything Peder and I have implemented. And even though I realize that this might be a serious competition, I would feel really bad not to mention this here: http://rsdn.ru/Forum/?mid=1094305 Thoughts? In particular, how do people feel about implementing someting for some particular compiler using specific "features" of this compiler? Should this be acceptable? Regards, Arkadiy -- Regards, Arkadiy

"Arkadiy Vertleyb" <vertleyb@hotmail.com> writes:
Microsoft-specific "bugfeatures" are generally not in the area of my interests. However I do realize that, on the Microsoft compiler, this might look much more attractive then anything Peder and I have implemented. And even though I realize that this might be a serious competition, I would feel really bad not to mention this here:
http://rsdn.ru/Forum/?mid=1094305
Thoughts?
In particular, how do people feel about implementing someting for some particular compiler using specific "features" of this compiler? Should this be acceptable?
Sure, as long as the rest of the implementation is portable. You can hide any non-portable magic you want behind #ifdef SOME_COMPILER ... #endif ;-) -- Dave Abrahams Boost Consulting www.boost-consulting.com

On Tue, 29 Mar 2005 09:47:13 -0500, Arkadiy Vertleyb <vertleyb@hotmail.com> wrote:
HI all,
God only knows what else can be found inside this compiler if one is willing to dig real deep.
For example, Igor' Chesnokov from RSDN (Russian Software Development Network) has found a way to implement typeof() that does not require registration, and probably has compile-time performance of a native typeof.
How? Apparently, some weird "feature" of Visual C++ allowed him to twick a template body at the moment of instantiation, when additional context is available, thus "registering" classes on the fly, at the moment of taking typeof().
Microsoft-specific "bugfeatures" are generally not in the area of my interests. However I do realize that, on the Microsoft compiler, this might look much more attractive then anything Peder and I have implemented. And even though I realize that this might be a serious competition, I would feel really bad not to mention this here:
http://rsdn.ru/Forum/?mid=1094305
Thoughts?
Wow. Very impressive. What a pity noone has thought of that earlier... I have modified the current vintage implementation to use this form of typeof, allowing it to compile with VC6.5 as well. I guess this deprecates most of the vintage code, since that was implemented in order to allow support of VC6.5 and VC7.0. This actually makes it possible to properly implement remove_xxx for VC6.5 and VC7.0 without any form of registration :) Regards, Peder
In particular, how do people feel about implementing someting for some particular compiler using specific "features" of this compiler? Should this be acceptable?
Regards,
Arkadiy
-- Regards, Arkadiy
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Peder Holt <peder.holt@gmail.com> writes:
This actually makes it possible to properly implement remove_xxx for VC6.5 and VC7.0 without any form of registration :)
Whoa. That is *major*... at least for those platforms it is. Awesome! Is this a full replacement for partial specialization? -- Dave Abrahams Boost Consulting www.boost-consulting.com

Peder Holt <peder.holt@gmail.com> writes:
This actually makes it possible to properly implement remove_xxx for VC6.5 and VC7.0 without any form of registration :)
Whoa. That is *major*... at least for those hopefully-soon-to-be-obsolete compilers it is. Awesome! Is this a full replacement for partial specialization? -- Dave Abrahams Boost Consulting www.boost-consulting.com

"David Abrahams" <dave@boost-consulting.com> wrote
This actually makes it possible to properly implement remove_xxx for VC6.5 and VC7.0 without any form of registration :)
Whoa. That is *major*... at least for those hopefully-soon-to-be-obsolete compilers it is. Awesome! Is this a full replacement for partial specialization?
This implementtion doesn't use any template specialzation. It works pretty much like this: 1) Pass expression into a function template; 2) Use VC bugfeature to instantiate a template, something like this: struct blah<ID> { typedef T type; // T is known inside the function template }; 3) return ID through the sizeof(); 4) use blah<ID>::type No specializations, no encoding -- nothing. Compiles in no time at all and handles anything. Regards, Arkadiy

"Arkadiy Vertleyb" <vertleyb@hotmail.com> writes:
"David Abrahams" <dave@boost-consulting.com> wrote
This actually makes it possible to properly implement remove_xxx for VC6.5 and VC7.0 without any form of registration :)
Whoa. That is *major*... at least for those hopefully-soon-to-be-obsolete compilers it is. Awesome! Is this a full replacement for partial specialization?
This implementtion doesn't use any template specialzation.
I know that. I just asked if the mechanism _replaces_ partial specialization. Of course it doesn't do that fully, since partial specialization can be used non-intrusively. -- Dave Abrahams Boost Consulting www.boost-consulting.com

On Wed, 30 Mar 2005 11:22:22 -0500, David Abrahams <dave@boost-consulting.com> wrote:
"Arkadiy Vertleyb" <vertleyb@hotmail.com> writes:
"David Abrahams" <dave@boost-consulting.com> wrote
This actually makes it possible to properly implement remove_xxx for VC6.5 and VC7.0 without any form of registration :)
Whoa. That is *major*... at least for those hopefully-soon-to-be-obsolete compilers it is. Awesome! Is this a full replacement for partial specialization?
This implementtion doesn't use any template specialzation.
I know that. I just asked if the mechanism _replaces_ partial specialization. Of course it doesn't do that fully, since partial specialization can be used non-intrusively.
When developing typeof-support for VC6, I also implemented remove_xxx based on typeof, so, yes. The new implementation of remove_xxx + typeof is a full replacement for partial specialization. Regards Peder
-- Dave Abrahams Boost Consulting www.boost-consulting.com
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Peder Holt <peder.holt@gmail.com> writes:
On Wed, 30 Mar 2005 11:22:22 -0500, David Abrahams <dave@boost-consulting.com> wrote:
"Arkadiy Vertleyb" <vertleyb@hotmail.com> writes:
"David Abrahams" <dave@boost-consulting.com> wrote
This actually makes it possible to properly implement remove_xxx for VC6.5 and VC7.0 without any form of registration :)
Whoa. That is *major*... at least for those hopefully-soon-to-be-obsolete compilers it is. Awesome! Is this a full replacement for partial specialization?
This implementtion doesn't use any template specialzation.
I know that. I just asked if the mechanism _replaces_ partial specialization. Of course it doesn't do that fully, since partial ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ specialization can be used non-intrusively. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When developing typeof-support for VC6, I also implemented remove_xxx based on typeof, so, yes. The new implementation of remove_xxx + typeof is a full replacement for partial specialization.
?? I think I answered my own question to the contrary. -- Dave Abrahams Boost Consulting www.boost-consulting.com

"David Abrahams" <dave@boost-consulting.com> wrote
Peder Holt <peder.holt@gmail.com> writes:
On Wed, 30 Mar 2005 11:22:22 -0500, David Abrahams <dave@boost-consulting.com> wrote:
"Arkadiy Vertleyb" <vertleyb@hotmail.com> writes:
"David Abrahams" <dave@boost-consulting.com> wrote
This actually makes it possible to properly implement remove_xxx for VC6.5 and VC7.0 without any form of registration :)
Whoa. That is *major*... at least for those hopefully-soon-to-be-obsolete compilers it is. Awesome! Is this a full replacement for partial specialization?
This implementtion doesn't use any template specialzation.
I know that. I just asked if the mechanism _replaces_ partial specialization. Of course it doesn't do that fully, since partial ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ specialization can be used non-intrusively. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When developing typeof-support for VC6, I also implemented remove_xxx based on typeof, so, yes. The new implementation of remove_xxx + typeof is a full replacement for partial specialization.
?? I think I answered my own question to the contrary.
This mechanism works similarly to template specialization, but of course it cannot substitute it, since it has to be applied in the specific way, something like this: template<int ID> struct base { struct nested; // not defined }; template<class T, int ID> struct derived { struct base::nested // define base's nested class here -- totally non-conformant { typedef T type; // we know T here }; }; Now, when derived<T, ID> is instantiated, base<ID> is also instantiated. But, at this point it gets its nested struct, and it contains the magic typedef... Now base<ID>::nested::type is the type we need. Not exactly template specialization. Rather "template re-definition at the point of instantiation" :-) Regards, Arkadiy

"Peder Holt" <peder.holt@gmail.com> wrote ... <off topic> Hey, welcome back! How was your vacation? </off topic>
Wow. Very impressive. What a pity noone has thought of that earlier...
How is one supposed to think of something like this? The next thing we find out -- VC might already have an undocumented typeof -- just called differently :-)
I have modified the current vintage implementation to use this form of typeof, allowing it to compile with VC6.5 as well.
Did you remove __if_exists/if_not_exists stuff? This would mean it would also compile with the language extentions disabled...
I guess this deprecates most of the vintage code, since that was implemented in order to allow support of VC6.5 and VC7.0.
And also removes half of the users from the compliant implementation. Really, how many are left if gcc has native typeof, and vc7 uses this stuff?? Well, competition is competition... I think we should contact the guy and ask if he is interested in working with us. If not -- we can use his code, but I think this would be fair to ask. I'll do this later today. Regards, Arkadiy

On Wed, 30 Mar 2005 06:51:03 -0800, Arkadiy Vertleyb <vertleyb@hotmail.com> wrote:
"Peder Holt" <peder.holt@gmail.com> wrote ...
<off topic>
Hey, welcome back!
Thanks :)
How was your vacation?
Great! Travelling with a 3 month old baby to the other side of the world is now proven to be doable :)
</off topic>
Wow. Very impressive. What a pity noone has thought of that earlier...
How is one supposed to think of something like this? The next thing we find out -- VC might already have an undocumented typeof -- just called differently :-)
I have modified the current vintage implementation to use this form of typeof, allowing it to compile with VC6.5 as well.
Did you remove __if_exists/if_not_exists stuff? This would mean it would also compile with the language extentions disabled...
Yep. VC6.5 does not implement __if_exists. I used the compile-time-constants implementation that already exists with the vintage implementation, so now it relies on two compiler bug/features + ODR in stead of one compiler bug/feature + a compiler extension :)
I guess this deprecates most of the vintage code, since that was implemented in order to allow support of VC6.5 and VC7.0.
And also removes half of the users from the compliant implementation. Really, how many are left if gcc has native typeof, and vc7 uses this stuff??
Well, competition is competition...
I think we should contact the guy and ask if he is interested in working with us. If not -- we can use his code, but I think this would be fair to ask. I'll do this later today.
Good idea. Do that Regards Peder
Regards, Arkadiy
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Arkadiy Vertleyb wrote:
HI all,
God only knows what else can be found inside this compiler if one is willing to dig real deep.
For example, Igor' Chesnokov from RSDN (Russian Software Development Network) has found a way to implement typeof() that does not require registration, and probably has compile-time performance of a native typeof.
Sadly (?) the bug that allows this to work is fixed in VC8. -cd
participants (5)
-
Andy Little
-
Arkadiy Vertleyb
-
Carl Daniel
-
David Abrahams
-
Peder Holt