Hi Wolfgang,
std::pair<Tuple, Tuple> is the correct one.
I tried your suggestion with std::make_pair and I still get:
====
/usr/include/c++/4.4.3/bits/stl_function.h(230): error: no operator "<"
matches these operands
operand types are: const Tuple < const Tuple
{ return __x < __y; }
^
detected during:
instantiation of "bool std::less<_Tp>::operator()(const _Tp &,
const _Tp &) const [with _Tp=Tuple]" at line 1170 of
"/usr/include/c++/4.4.3/bits/stl_tree.h"
instantiation of "std::pair<std::_Rb_tree_iterator<_Val>, bool>
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_M_insert_unique(const _Val &) [with _Key=Tuple,
_Val=std::pair<const Tuple, Tuple>,
_KeyOfValue=std::_Select1st<std::pair<const Tuple, Tuple>>,
_Compare=std::less<Tuple>, _Alloc=std::allocator<std::pair<const Tuple,
Tuple>>]" at line 500 of "/usr/include/c++/4.4.3/bits/stl_map.h"
instantiation of "std::pair<std::_Rb_tree<_Key, std::pair<const
_Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp>>, _Compare,
_Alloc::rebind<std::pair<const _Key, _Tp>>::other>::iterator, bool>
std::map<_Key, _Tp, _Compare, _Alloc>::insert(const std::pair<const _Key,
_Tp> &) [with _Key=Tuple, _Tp=Tuple, _Compare=std::less<Tuple>,
_Alloc=std::allocator<std::pair<const Tuple, Tuple>>]" at line 776 of
"main.cc"
instantiation of "void Foo<dim>::setup_system() [with dim=3]" at
line 1069 of "main.cc"
instantiation of "void Foo<dim>::run() [with dim=3]" at line
1163 of "main.cc"
====
I don't see why an operator < wouldn't match the operands.
Theodore
On 1 April 2011 02:34, Wolfgang Bangerth <[email protected]> wrote:
>
> > myMap.insert( std::pair<Tuple, Tuple>( boost::make_tuple(x, y, z),
> > boost::make_tuple(A, B, C) ) );
> > [...]
> > The error I get is:
> > main.cc(776): error: argument list for class template "std::pair" is
> > missing myMap.insert( std::pair( boost::make_tuple(x, y, z),
> > boost::make_tuple(A, B, C) ) );
>
> There is a mismatch here: the code you cite specifies the template
> arguments
> for std::pair, but the error message doesn't. Which is correct? Since
> std::pair is a template class, you need to specify the types. You could
> alternatively replace the call to std::pair<...,...>(...,...) by a call to
> std::make_pair.
>
> W.
>
> -------------------------------------------------------------------------
> Wolfgang Bangerth email: [email protected]
> www: http://www.math.tamu.edu/~bangerth/
>
--
Best regards,
Theodore
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii