Boost logo

Boost Users :

Subject: Re: [Boost-users] MPL newbie : what is the difference between mpl::true_ and true_type
From: Philipp Moeller (philipp.moeller_at_[hidden])
Date: 2012-01-31 06:28:38


Linh Ha <lha_at_[hidden]> writes:

> I'm a newbie for both boost and MPL. My question is regarding about
> the differences between mpl::true_ and true_type. While from my point
> of view they are both structure of constant boolean. Even in the
> implementation true_type is derived from mpl:true_. So why we need
> both data structure instead of only single one. When we should use
> mpl::true_ instead and true_type and vice versa
>

They are identical and compatible but belong to different libraries. The
benefit is, that MPL can interoperate with TypeTraits. I try to use
whichever is most appropriate. If I write something that resembles a
type trait, I'll use integral_constant from type traits and vice
versa.

-- 
Philipp Moeller

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net