Skip to content

Small implementation of lambdas in C++03. Modeled after Args, Vals, Refs, and Functions from Boost.Phoenix.

Notifications You must be signed in to change notification settings

nopppers/03-lambda-stuff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

03-lambda-stuff

Small implementation of lambdas in C++03. Modeled after Args, Vals, Refs, and Functions from Boost.Phoenix.

Example usage:

size_t count_matching_substrings(const std::vector<std::string> &strs, const std::string &substring)
{
    return std::count_if(strs.begin(), strs.end(),
                         NotEq(Find(arg1,
                                    substring,
                                    0),
                               std::string::npos));
}

std::vector<std::string> find_strings_of_length(const std::vector<std::string &strs, size_t length)
{
    std::vector<std::string> found;
    
    // Whoops, that's C++11.
    std::copy_if(strs.begin(), strs.end(), 
                 std::back_inserter(found),
                 Eq(Length(arg1)
                    length));
    return found;
}

About

Small implementation of lambdas in C++03. Modeled after Args, Vals, Refs, and Functions from Boost.Phoenix.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published