
With some wrangling, I figured out how to use the is_pod function, but I discovered it has little value to me unless I can get the status of a class/struct. Has there been any progress in this area? Thanks.

AMDG Elli Barasch wrote:
With some wrangling, I figured out how to use the is_pod function, but I discovered it has little value to me unless I can get the status of a class/struct. Has there been any progress in this area?
What compiler are you using? msvc 8.0 and up and gcc 4.3.0 among others have intrinsics for this purpose. You can check whether the preprocessor symbol BOOST_HAS_TYPE_TRAITS_INTRINSICS is defined. See boost/type_traits/intrinsics.hpp In Christ, Steven Watanabe

Steven Watanabe wrote:
AMDG
Elli Barasch wrote:
With some wrangling, I figured out how to use the is_pod function, but I discovered it has little value to me unless I can get the status of a class/struct. Has there been any progress in this area?
What compiler are you using? msvc 8.0 and up and gcc 4.3.0 among others have intrinsics for this purpose. You can check whether the preprocessor symbol BOOST_HAS_TYPE_TRAITS_INTRINSICS is defined. See boost/type_traits/intrinsics.hpp
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
gcc 4.2.3. Thanks.

I'm trying to avoid performance-heavy serialization on an object. I can short-cut the serialization if I can determine if my object is POD.
That could be a bit dangerous. is_pod can given different result with different compilers. (With some compilers is_pod is better at detecting PODness then with other compilers.) That could hurt the portability of the archives between different platforms. --Johan

Hello,
That could be a bit dangerous. is_pod can given different result with different compilers.
I thought that is_pod and all other Boost.TypeTraits metafunctions were much more reliable than what you say. If this assertion is true, why do regression tests for is_pod pass successfully on all platforms? Tests purposely don't include the problematic cases you're talking about? Thanks Bruno

Bruno Lalande wrote:
Hello,
That could be a bit dangerous. is_pod can given different result with different compilers.
I thought that is_pod and all other Boost.TypeTraits metafunctions were much more reliable than what you say.
From the is_pod documentation: "Without some (as yet unspecified) help from the compiler, ispod will never report that a class or struct is a POD; this is always safe, if possibly sub-optimal. Currently (May 2005) only MWCW 9 and Visual C++ 8 have the necessary compiler-_intrinsics." --Johan

From the is_pod documentation:
"Without some (as yet unspecified) help from the compiler, ispod will never report that a class or struct is a POD; this is always safe, if possibly sub-optimal. Currently (May 2005) only MWCW 9 and Visual C++ 8 have the necessary compiler-_intrinsics."
Ah yes, now I remember having read that already. The "safe, if possibly sub-optimal" statement had reassured me but indeed as Elli wants to work specifically on objects, his whole purpose might be defeated. Thanks Bruno
participants (4)
-
Bruno Lalande
-
Elli Barasch
-
Johan Råde
-
Steven Watanabe