Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6065265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:22:16+00:00 2026-05-23T09:22:16+00:00

The following code does not compile on g++ (GCC) 4.6.0 20110603 (prerelease) with -std=c++0x

  • 0

The following code does not compile on g++ (GCC) 4.6.0 20110603 (prerelease) with -std=c++0x and Boost 1.46.1.
Am I missing an include or is this actually a bug? If the latter, how to work around it?

#include <boost/mpl/vector.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/mpl/clear.hpp>

#include <boost/fusion/mpl.hpp>
#include <boost/fusion/include/clear.hpp>
#include <boost/fusion/include/clear.hpp>

#include <boost/fusion/adapted/boost_tuple.hpp>
#include <boost/fusion/include/boost_tuple.hpp>

namespace mpl = boost::mpl;

template<typename T>
struct Meta {
  T t;
  typedef mpl::vector<std::function<void(double)>, std::function<void(char)>, 
              std::function<void(int)>> MplVector;
  typedef T FusionSequence;

  //works
  typedef mpl::transform< MplVector, mpl::identity<mpl::_1> >::type result;
  //doesn't, work
  typedef typename mpl::transform< FusionSequence, mpl::identity<mpl::_1> >::type result2;
};

template<typename T>
Meta<T> make_meta(T t) { return Meta<T>({t}); }

int main()
{
  auto m = make_meta(boost::make_tuple(
               std::function<void(double)>([](double) { }),
               std::function<void(int)>([](int) { }),
               std::function<void(char)>([](char) { })));
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:22:16+00:00Added an answer on May 23, 2026 at 9:22 am

    When you do not provide an inserter, transform has to generate one for you (the result has to be accumulated somewhere), which essentially amounts to doing something like back_inserter< clear<OriginalSequence>::type >. The transform docs are somewhat misleading here since they do not document this extra requirement for the “no-inserter” versions of the algorithm.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code compiles in MSVC++, but does not compile in GCC 4.5.1: #include
I have the following bit of legacy C++ code that does not compile: #include
The following code does not compile with gcc 4.7 (20120114) , but compiles fine
Can anyone explain why the following code does not compile (on g++ (GCC) 3.2.3
Following code does compile in gcc 4.5 but it is not being compiled in
The following code does not compile in gcc: namespace One{ class A{ }; };
This code does not compile for me on GCC version 4.3.2 (Debian 4.3.2-1.1) main()
The following code does not compile: public class GenericsTest { public static void main(String[]
The following Code does not compile Dim BasicGroups As String() = New String() {Node1,
The following code does not compile, saying error C2248: 'A::getMe' : cannot access private

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.