List of 5 seemingly Secret MetroRT/DirectX information in VS11 and 1 secret in VS 2010

Is it me, or does it seem like the DirectX 11 tutorials are somewhat lacking?  Of course it is me.  My aluminum foil hat slipped down over my eyes. 

Now that the Windows 8 Customer Review and VS 11 Beta versions get more in sync, there is more material, but generally it is in a number of locations.  Now I guess that I should show the links here, but we need to have some code as well right?

What is the secret information?  Isn’t really secret, but finding it makes it seem like it is secret, and I found a cache of C++ information yesterday that was a head blower upper:

  1. Welcome Back to C++ (Modern C++)
  2. C++11 Features (Modern C++)
  3. C++ Type System (Modern C++)
  4. Object Lifetime And Resource Management (Modern C++)
  5. Objects Own Resources (RAII)

Oh sure you might say: “I could have found this by going to MSDN”, and I would ask: “But did you?

And now some code you can cut and paste into the VS 11 that may or may not help you understand the universe at large any better.

In this case, Lambda Expressions were introduced in C# and VC++ in VS 2010, I thought it was introduced to make code harder to read and to increase the complexity of the code.  I could be right, or it could be that I forgot to take my vitamins today.

SOOOO If you are using VS 2010 and haven’t used Lambda expressions, then you might was well get started NOW.

Most of my material is from: https://msdn.microsoft.com/en-us/library/dd293603(v=vs.110).aspx

The structural elements of a lambda expression

And here is the code as I modified it, requires only a single CPP to work, no header file needed:

  
 #include <algorithm>
 #include <iostream>
 #include <vector>
 using namespace std;
  
 // The number of elements in the vector.
 const int intCount = 20;
  
 int main() 
 {
    // Create a vector object with each element set to 1.
    vector<int> vHector(intCount, 1);
  
    // These variables hold the previous two elements of the vector.
    int x = 1;
    int y = 1;
    cout<<"What is in vHector before generate_n "<<endl;
    for_each(vHector.begin(), vHector.end(), [](int n) { cout << n << " "; });
    cout << endl;
  
     /*    Assign each element in the vector to the sum of the 
         previous two elements. For more about generate_end
         https://msdn.microsoft.com/en-us/library/a6acakce(v=vs.110).aspx 
         For more about mutable throw see*/
  
    generate_n(vHector.begin() + 1, intCount - 1, [=]() mutable throw() -> int {
       
       // Generate current value.
       int m = x + y;
  
       // Update previous two values.
       x = y;
       y = m;
  
       return n;
    });
  
    // Print the contents of the vector.
    cout<<"What is in vHector after generate_n "<<endl;
    for_each(vHector.begin(), vHector.end(), [](int m) { cout << m << " "; });
    cout << endl;
  
    // Print the local variables x and y.
    // The values of x and y hold their initial values because 
    // they are captured by value.
    cout<<"What x and y held initially"<<endl;
    cout <<"Initially x held "<< x << " Initially y held " << y << endl;
  
    system("Pause");
  
 }