"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "kdbg/testprogs/lambda.cpp" between
kdbg-3.0.0.tar.gz and kdbg-3.0.1.tar.gz

About: KDbg is a graphical user interface to GDB, the GNU debugger (requires KDE, the K Desktop Environment).

lambda.cpp  (kdbg-3.0.0):lambda.cpp  (kdbg-3.0.1)
// test C++11 lambdas // test lambdas and other function names
#include <algorithm> #include <algorithm>
#include <initializer_list> #include <initializer_list>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
template<typename T> template<typename T>
struct X struct X
{ {
X() = default; X() = default;
skipping to change at line 27 skipping to change at line 27
} }
} }
void outmult(int factor) void outmult(int factor)
{ {
auto f = [&factor](const T& a) { auto f = [&factor](const T& a) {
std::cout << (a*factor) << std::endl; std::cout << (a*factor) << std::endl;
}; };
for_each(m_v.begin(), m_v.end(), f); for_each(m_v.begin(), m_v.end(), f);
} }
std::vector<T> m_v; std::vector<T> m_v;
int refqual() const &
{
return 3;
}
int refqual() &&
{
return 4;
}
}; };
int main() int main()
{ {
X<unsigned> x{ 1, 1, 2, 3, 5, 8 }; X<unsigned> x{ 1, 1, 2, 3, 5, 8 };
x.outmult(3); x.outmult(3);
std::cout << x.refqual() << std::endl;
std::cout << X<int>().refqual() << std::endl;
} }
 End of changes. 3 change blocks. 
1 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)