Declaring tricky templated variables such as disjoint_sets.

Hi,
this is a somewhat general C++ question, but I'm specifically concerned
about a Boost class in this case.
How do I declare a boost::disjoint_sets

this is a somewhat general C++ question, but I'm specifically concerned about a Boost class in this case.
How do I declare a boost::disjoint_sets
variable without some kind of automatic template deduction? Usually I see such classes declared taking their template parameters from within a function such as: template
void foo(Rank rank, Parent parent) { disjoint_sets dset; } but what if I want to declare dset at file scope? I've been trying to manually construct the Rank and Parent types, but it's slightly doing my head in and the iterator_property_map example seems to be stale.
Is there a general C++ technique or a Boost-specific one that can help me out here? Or is it just a matter of laboriously building up the typedefs? Thanks, cheers.
If you're using C++11, you can express the type of an expression
'expr' as 'decltype(expr)'. So, for example, you can write down
the type of disjoint set that would be declared by the call
foo(some_rank_expression, some_parent_expression)
as
disjoint_set
participants (2)
-
Jeremy Murphy
-
Nathan Ridge