I realized some of the things I was doing in the sample code are pretty stupid.� I&#39;m still not sure why the compilation was failing on the phoenix code.� I&#39;ll repost once I figure out what I&#39;m doing.� Sorry for the noise.<br>
<br><br><div class="gmail_quote">On Tue, Nov 24, 2009 at 12:09 PM, James Knight <span dir="ltr">&lt;<a href="mailto:james.nate.knight@gmail.com">james.nate.knight@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m having a problem using Boost.Phoenix.� I&#39;m currently building against Boost 1.41 using gcc 4.3.2.<br><br>I&#39;ve simplified my use case quite a bit, so please forgive the obtuseness of the example.� The following code fails to compile:<br>

<br>~~~~~~~~~~~~~~~~~~~~<br><br>#include &lt;boost/fusion/include/std_pair.hpp&gt;���� <br>#include &lt;boost/spirit/home/phoenix/core/argument.hpp&gt;���� <br>#include &lt;boost/spirit/home/phoenix/fusion.hpp&gt;���������������������� <br>

#include &lt;boost/spirit/home/phoenix/operator.hpp&gt;���� <br>��������������������������������������������������������������������� <br>#include &lt;vector&gt;�������������������������������������������������������������������������������������� <br>

#include &lt;map&gt;������������������������������������������������������������������ <br>#include &lt;algorithm&gt;������������� <br>��������������������������������������� <br>namespace phx = boost::phoenix;�������������������������� <br>

using namespace phx::arg_names;���������� <br>using phx::at_c;����������������� <br>using std::map;������������������������������������������������������������ <br>using std::multimap;��������������������������������������������������� <br>

using std::vector;������������������������ <br>�������������������������������������������������� <br>int main()�������������� <br>{������������������������������������������������������������������������������������������������������ <br>

��� typedef map&lt;vector&lt;char&gt;,int&gt; char_int_map_t;������������������������������������������������������ <br>��� typedef multimap&lt;int,char_int_map_t::iterator&gt; int_iter_map_t;������������������������������������� <br>

��� typedef map&lt;vector&lt;char&gt;, char_int_map_t::iterator&gt; char_iter_map_t;������������������������������� <br>������������������������������������������������������������������������������������������������������� <br>

��� int int_key = 5;����������������������������������������������������������������������������������� <br>������������������������������������������������������������������������������������������������������� <br>��� char_int_map_t int_map;���������������������������������������������������������������������������� <br>

��� int_iter_map_t int_iter_map;����������������������������������������������������������������������� <br>������������������������������������������������������������������������������������������������������� <br>��� char_iter_map_t char_iter_map1, char_iter_map_t2;�������������������������������������������������� <br>

������������������������������������������������������������������������������������������������������� <br>��� int_iter_map_t::iterator start,stop;��������������������������������������������������������������� <br>��� std::pair&lt;int_iter_map_t::iterator,int_iter_map_t::iterator&gt;��������������������������������������� <br>

������� er = int_iter_map.equal_range(int_key);��� <br>������������������ <br>��� std::set_intersection(��� <br>������� char_iter_map1.begin(), char_iter_map1.end(),��� <br>������� er.first,er.second,��� <br>������� inserter(char_iter_map_t2,char_iter_map_t2.begin()),��� <br>

������� phx::at_c&lt;0&gt;(arg1) &lt; phx::at_c&lt;0&gt;(*phx::at_c&lt;1&gt;(arg2))��� // &lt;- COMPILE FAILURE<br>��� );���������������������������������������������� <br>} <br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
<br>
Here is the information I can offer,<br><br>1) When the key in char_int_map_t and char_iter_map_t is a char rather than a vector&lt;char&gt; this compiles without problems.<br>2) The gcc error shows that the arguments to the generated function object are being switched (I think, see below)<br>

<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>...<br>.../comparison.hpp:29:5: error: no match for �operator&lt;� in �result_of_less&lt;const int&amp;, const vector&lt;char&gt;&amp;&gt;::x &lt; result_of_less&lt;const int&amp;, const vector&lt;char&gt;&amp;&gt;::y� <br>

.../comparison.hpp: In instantiation of �const int result_of_less&lt;const int&amp;, const vector&lt;char&gt;&amp;&gt;::index�:<br>.../comparison.hpp:29:�� instantiated from �result_of_less&lt;const int&amp;, const vector&lt;char&gt;&amp;&gt;�<br>

.../mpl/eval_if.hpp:38:�� instantiated from �eval_if&lt;or_&lt;is_actor&lt;const int&amp;&gt;, is_actor&lt;const vector&lt;char&gt;&amp;&gt;, mpl_::bool_&lt;false&gt;, mpl_::bool_&lt;false&gt;, mpl_::bool_&lt;false&gt; &gt;, re_curry&lt;less_eval, const int&amp;, const vector&lt;char&gt;&amp;&gt;, result_of_less&lt;const int&amp;, const vector&lt;char, allocator&lt;char&gt; &gt;&amp;&gt; &gt;�<br>

.../comparison.hpp:39:�� instantiated from �<br><br>boost::phoenix::less_eval::result&lt;<br>��� boost::phoenix::basic_environment&lt;<br>������� std::pair&lt;������������������������������������������������������������������������������ // This should be the second argument, no?<br>

����������� const int,���������������������������������������������������������������������������� <br>����������� std::_Rb_tree_iterator&lt;std::pair&lt;const std::vector&lt;char, std::allocator&lt;char&gt; &gt;, int&gt;&gt;�� <br>

������� &gt;,� <br>������� std::pair&lt;<br>����������� const std::vector&lt; char, std::allocator&lt;char&gt; &gt;,<br>����������� std::_Rb_tree_iterator&lt;std::pair&lt;const std::vector&lt;char, std::allocator&lt;char&gt; &gt;, int&gt;&gt;�� <br>

������� &gt;�� <br>��� &gt;,� <br>��� boost::phoenix::composite&lt;<br>������� boost::phoenix::at_eval&lt;0&gt;, <br>������� boost::fusion::vector&lt;<br>����������� boost::phoenix::argument&lt;0&gt;<br>������� &gt;�� <br>

��� &gt;,� <br>��� boost::phoenix::composite&lt;<br>������� boost::phoenix::at_eval&lt;0&gt;, <br>������� boost::fusion::vector&lt;<br>����������� boost::phoenix::composite&lt;<br>��������������� boost::phoenix::dereference_eval, <br>

��������������� boost::fusion::vector&lt;<br>������������������� boost::phoenix::composite&lt;<br>����������������������� boost::phoenix::at_eval&lt;1&gt;, <br>����������������������� boost::fusion::vector&lt;<br>��������������������������� boost::phoenix::argument&lt;1&gt;<br>

����������������������� &gt;�� <br>������������������� &gt;�� <br>��������������� &gt;�� <br>����������� &gt;�� <br>������� &gt;�� <br>��� &gt;�� <br>&gt;<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br><br>3) Finally, if I use the expression<br>

<br>��� phx::at_c&lt;0&gt;(arg1) &lt; *phx::at_c&lt;1&gt;(arg2)<br><br>the code still fails to compile (obviously), but does seem to get the arguments in the correct order.<br><br>Any ideas?<br><br>Thanks<br>Nate<br>
</blockquote></div><br>