Boost logo

Boost :

From: Ed Brey (brey_at_[hidden])
Date: 1999-07-07 08:34:01


Email seemed somewhat boring, until Valentin Bonnard wrote:
>
>See
>http://www.eleves.ens.fr:8080/home/bonnard/ContAlgo/ContTraits.hpp
>for an _example_ (I will probably rewrite it).

[And a quote from that example:

namespace TypeLogic {
struct yes {};
struct no {};
struct maybe {};
} // TypeLogic

// struct Container

template <typename T>
struct container_trait
{
  static const bool is_specialised = false;
  typedef TypeLogic::maybe is_sequence;
  typedef TypeLogic::maybe is_associative;
  typedef TypeLogic::maybe is_node_based;
};

-- end quote]

What is the rational behind using the TypeLogic. I would have expected
something like this for the tri-state variables:

enum tristate {yes, no, maybe};

template <typename T>
struct container_trait
{
  static const bool is_specialised = false;
  static const tristate is_sequence = maybe;
  static const tristate is_associative = maybe;
  static const tristate is_node_based = maybe;
};

------------------------------------------------------------------------

eGroups.com home: http://www.egroups.com/group/boost
http://www.egroups.com - Simplifying group communications


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk