constexpr for c++11
Added for_each() function and list method