변환을 mpl::string
에 적용하려고하지만 컴파일 할 수 없습니다. 저는 MS VC++ 2010과 Boost 1.43.0을 사용하고 있습니다. 코드 :mpl :: transform에 mpl :: transform을 적용하는 방법은 무엇입니까?
#include <boost/mpl/string.hpp>
#include <boost/mpl/vector_c.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/mpl/plus.hpp>
#include <boost/mpl/arithmetic.hpp>
using namespace boost;
int main() {
// this compiles OK
typedef mpl::vector_c<int, 'abcd', 'efgh'> numbers;
typedef mpl::transform<numbers, mpl::plus<mpl::_1, mpl::int_<1> > >::type result_numbers;
// this doesn't (error C2039: 'value' : is not a member of 'boost::mpl::has_push_back_arg')
typedef mpl::string<'abcd', 'efgh'> chars;
typedef mpl::transform<chars, mpl::plus<mpl::_1, mpl::int_<1> > >::type result_chars;
}
http://paste.ubuntu.com/447759/에 전체 오류 메시지를 게시했습니다.
MPL에 워드 프로세서
는mpl::transform
가
Forward Sequence
을 필요로하고
mpl::string
내가
Forward Sequence
의 유형입니다 모여
Bidirectional Sequence
이라고 말하고, 그래서 그것을 작동 거라고 생각했다.
내가 잘못했거나 완전히 불가능합니까? 그렇다면 왜?
감사합니다.
* "내가 뭔가 잘못하고 있니?"* 음, C++에서 템플릿 메타 프로그래밍을 시도하고 있습니까? *** 오리 *** –
_MS_ VC 2010을 사용하는 경우 왜 _Ubuntu_ 웹 사이트에 문제를 게시하고 있습니까? – KitsuneYMG