Search Results

Search found 2 results on 1 pages for 'ckarras'.

Page 1/1 | 1 

  • Boost lambda: Invoke method on object

    - by ckarras
    I'm looking at boost::lambda as a way to to make a generic algorithm that can work with any "getter" method of any class. The algorithm is used to detect duplicate values of a property, and I would like for it to work for any property of any class. In C#, I would do something like this: class Dummy { public String GetId() ... public String GetName() ... } IEnumerable<String> FindNonUniqueValues<ClassT> (Func<ClassT,String> propertyGetter) { ... } Example use of the method: var duplicateIds = FindNonUniqueValues<Dummy>(d => d.GetId()); var duplicateNames = FindNonUniqueValues<Dummy>(d => d.GetName()); I can get the for "any class" part to work, using either interfaces or template methods, but have not found yet how to make the "for any method" part work. Is there a way to do something similar to the "d = d.GetId()" lambda in C++ (either with or without Boost)? Alternative, more C++ian solutions to make the algorithm generic are welcome too. I'm using C++/CLI with VS2008, so I can't use C++0x lambdas.

    Read the article

  • Visual C++ 2008: Finding the cause of slow link times

    - by ckarras
    I have a legacy C++ project that takes an annoyingly long time to build (several minutes, even for small incremental changes), and I found most of the time was spent linking. The project is already using precompiled headers and incremental compilation. I have enabled the "/time" command line parameter in the hope I would get more details about what is slowing the linker, and got the following output: 1>Linking... 1> MD Merge: Total time = 59.938s 1> Generate Transitions: Total time = 0.500s 1> MD Finalize: Total time = 7.328s 1>Pass 1: Interval #1, time = 71.718s 1>Pass 2: Interval #2, time = 8.969s 1>Final: Total time = 80.687s 1>Final: Total time = 80.953s Is there a way to get more details about each of these steps? For example, I would like to find if they are spending most time linking to a specific .lib or .obj file. Also, is there any documentation that explains what each of these steps do?

    Read the article

1