Program Listing for File insertion_policies.hpp

Return to documentation for file (fwdpp/insertion_policies.hpp)

#ifndef _INSERTION_POLICIES_HPP_
#define _INSERTION_POLICIES_HPP_

#include <algorithm>
#include <fwdpp/fwd_functional.hpp>
namespace fwdpp
{
    struct emplace_back
    {
        template <typename T, typename cT>
        inline std::size_t
        operator()(T &&t, cT &ct) const
        {
            ct.emplace_back(std::forward<T>(t));
            return ct.size() - 1;
        }
    };
}
#endif /* _INSERTION_POLICIES_HPP_ */