title: icpc error implicitly generated assignment operator cannot copy reference member (boost graph)
body: <p>I am using a <code>boost::filter_iterator</code> to filter over of a pair of boost graph vertices as follows: </p>
  
  <p>I have a range of graph vertices using a <code>vertex_iterator</code> pair <code>&lt;vbegin, vend&gt;.</code> 
  I want to filter the range using a predicate and the range needs to be grouped 
  into say 4 sub-ranges</p>
  
  <pre><code>&lt;begin1, end1&gt; ... &lt;begin4, end4&gt;
  </code></pre>
  
  <p>So I filter over the vertex iterator using <code>boost::filter_iterator</code> and create 4 subranges.
  Such subrange iterator pairs need to be inserted into a container (vector) </p>
  
  <pre><code>std::vector&lt; pair&lt;filter_iterator, filter_iterator&gt; &gt;  my_vector
  size of vector = 4 (because 4 pairs are inserted)
  </code></pre>
  
  <p>A filter predicate with a given desired parameter helps define the filter iterator range </p>
  
  <pre><code>&lt;fbegin, fend&gt;
  </code></pre>
  
  <p>The code is as below : </p>
  
  <pre><code> template&lt;typename Graph&gt; 
   struct my_filter_pred {
     public:
       my_filter_pred() { }  
       my_filter_pred(Graph&amp; _G, int _value) : G(_G), value(_value) {  } 
  
       template&lt;typename vertex_t&gt;
       bool operator() (vertex_t vertex) {
  
          //get property "p" of vertex in graph G
          auto p = get (mypropertytype, vertex, G);
          return (p.val == value); 
       }
  
       private: 
        Graph&amp; G;
      }
  
    //get all vertices using vertex iterator
    vertex_iterator  vbegin, vend;
    boost::tie(vbegin, vend) = boost::vertices(G); 
  </code></pre>
  
  <p>The for - loop is as below"</p>
  
  <pre><code>  //for each i = 0,1,2,3 -&gt; create a predicate with i as parameter.
    //apply the filter predicate over the vertex_iterator range
    //insert in the begin, end pair into vector
  
    for (int i=0; i&lt;4; ++i) 
    {
      //for each i, create a filter_pred 
      my_filter_pred &lt;Graph&gt; filter_pred(G, i)
  
      //now create begin and end filter iterators as follows
      auto fbegin = boost::make_filter_iterator&lt; my_filter_pred&lt;Graph&gt;,
                                         vertex_iterator&gt;   (filter_pred, vbegin, vend)
      auto fend = boost::make_filter_iterator&lt; my_filter_pred&lt;Graph&gt;,
                                         vertex_iterator&gt;   (filter_pred, vend, vend)
  
      //fbegin, fend are of type filter iterator
      //insert the iterator pair into vector
      my_vector.push_back( std::make_pair (fbegin, fend) );
     }
  </code></pre>
  
  <p>Now: the problem testing part:</p>
  
  <p>I am using 2 compilers gcc4.9 and Inter 13.0.1 for testing this code. </p>
  
  <p>Results :</p>
  
  <pre><code>gcc 4.9 --&gt; works correctly, compiles fine and works fine as well. 
  icpc gives me the following error:
  
     error: implicitly generated assignment operator cannot copy:
          reference member "my_filter_pred &lt;Graph&gt;::G [with ... ]"
  </code></pre>
  
  <p>struct my_filter_pred { 
           ^
            detected during:</p>
  
  <p>I googled the error and I found this link on intel's website <a href="https://software.intel.com/en-us/articles/cdiag440" rel="nofollow">here</a> which describes 
  about the same error but no information is provided for such error. </p>
  
  <p>How do I solve this ? I tried adding the following into my predicate (function object)</p>
  
  <pre><code>   my_filter_pred&amp; operator=(const my_filter_pred&amp;);
     my_filter_pred(const my_filter_pred&amp;);
  </code></pre>
  
  <p>but after that I get "undefined reference to .... " error. How do I explicitly define the copy assignment operator and copy constructor</p>