摘要: 遇见C++ Lambda Written by Allen Lee If you die when there's no one watching, and your ratings drop and you're forgotten. – Marilyn Manson, Lamb Of God 生成随机数字 假设我们有一个vector<int>容器,想用100以内的随机数初始化它,其中一个办法是通过generate函数生成,如代码1所示。generate函数接受三个参数,前两个参数指定容器的起止位置,后一个参数指定生成逻辑,这个逻辑正是通过Lambda来表达的。代 阅读全文
posted @ 2012-07-03 08:50 Allen Lee 阅读(33610) 评论(24) 推荐(27) 编辑