title: Why is class member variable not allowed to be [ &A, &B ] in PPL
body: <p>Before compile VS says that</p>
  <p>Error member &quot;test::A&quot; is not a variable</p>
  <p>Error member &quot;test::B&quot; is not a variable</p>
  <p>Code:</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;ppl.h&gt;
  
  using namespace concurrency;
  using namespace std;
  
  class test
  {
          static double A[ 3 ][ 3 ];
          static double B[ 3 ][ 3 ];
  public:
          int test_function();
  };
  
  double test::A[ 3 ][ 3 ] = { {  0.7,  -0.2,   -1   },
                               { -4,    -2,     -2   },
                               { -0.4,   1.7,   -1.8 } };
  
  double test::B[ 3 ][ 3 ] = { {  0.6,  -1.2,    1.1 },
                               {  2,     3,     -2   },
                               { -1,     0.05,   0.05} };
  
  int test::test_function()
  {
      parallel_for ( 0, 100, [ &amp;A, &amp;B ]( int y ) {
          for ( int x = 0; x &lt; 100; x++ ) {
  
              for ( int i = 0; i &lt; 3; i++ )
                  for ( int j = 0; j &lt; 3; j++ )
                       A[ j ][ i ] += A[ j ][ i ] * B[ j ][ i ];
  
          }
      } );
  }
  
  int main()
  {
          return 0;
  }
  </code></pre>
  <p>Error:</p>
  <blockquote>
  <p>'test::A': a lambda capture variable must be from an enclosing function scope</p>
  <p>'test::B': a lambda capture variable must be from an enclosing function scope</p>
  </blockquote>
  <p>what should I do?</p>