#ifndef PYTHONIC_BUILTIN_STR_MOD_HPP #define PYTHONIC_BUILTIN_STR_MOD_HPP #include "pythonic/builtins/str/__mod__.hpp" #include "pythonic/types/str.hpp" #include "pythonic/utils/functor.hpp" #include PYTHONIC_NS_BEGIN namespace builtins { namespace str { namespace details { template void fmt(boost::format &f, Tuple const &a, utils::int_<1>) { f % std::get::value - 1>(a); } template void fmt(boost::format &f, Tuple const &a, utils::int_) { fmt(f % std::get::value - I>(a), a, utils::int_()); } } template types::str __mod__(types::str const &s, T const &arg) { const boost::format fmter(s.chars()); return (boost::format(fmter) % arg).str(); } template types::str __mod__(types::str const &s, std::tuple const &args) { boost::format fmter(s.chars()); details::fmt(fmter, args, utils::int_()); return fmter.str(); } template types::str __mod__(types::str const &s, types::array const &args) { boost::format fmter(s.chars()); details::fmt(fmter, args, utils::int_()); return fmter.str(); } } } PYTHONIC_NS_END #endif