
Hello all, I have questions about concepts (it's related to Boost.ConceptCheckign and Boost.Generic, but it's really just about the concept syntax that was proposed and never adopted for C++11). What's the difference between typename new_type = old_type and typedef old_type new_type? Why are they both allowed? For example, what's the difference between this: auto concept HasFind < typename T > { typename key_type = typename T::key_type; // use typename typename mapped_type; std::pair<key_type, mapped_type> find ( T const&, key_type const& ); } And this: auto concept HasFind < typename T > { typedef typename T::key_type key_type; // use typedef typename mapped_type; std::pair<key_type, mapped_type> find ( T const&, key_type const& ); } Thanks a lot. --Lorenzo -- View this message in context: http://boost.2283326.n4.nabble.com/boost-concept-typenames-vs-typedefs-tp460... Sent from the Boost - Dev mailing list archive at Nabble.com.

lcaminiti wrote
What's the difference between typename new_type = old_type and typedef old_type new_type? Why are they both allowed?
Got it: typename applies to concepts, typedef to concept_maps. Thanks. --Lorenzo -- View this message in context: http://boost.2283326.n4.nabble.com/boost-concept-typenames-vs-typedefs-tp460... Sent from the Boost - Dev mailing list archive at Nabble.com.

On Fri, May 4, 2012 at 11:06 PM, lcaminiti <lorcaminiti@gmail.com> wrote:
lcaminiti wrote
What's the difference between typename new_type = old_type and typedef old_type new_type? Why are they both allowed?
Got it: typename applies to concepts, typedef to concept_maps.
This may be coming a bit late, but the essential idea is that: typedef declarations assign values to associated types specified via template type parameter declarations. Hope this helps. Thanks, -- Larisse.
Thanks. --Lorenzo
-- View this message in context: http://boost.2283326.n4.nabble.com/boost-concept-typenames-vs-typedefs-tp460... Sent from the Boost - Dev mailing list archive at Nabble.com.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Larisse Voufo
-
lcaminiti