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 7803965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:45:29+00:00 2026-06-02T01:45:29+00:00

Before I move on – is there already a type list implementation either in

  • 0

Before I move on – is there already a type list implementation either in boost or a small implementation that uses it? I haven’t found anything useful so far.

I’m attempting to use boost pp to generate list classes of various sizes:

#define BOOST_PP_LOCAL_MACRO(n) \
    template< BOOST_PP_ENUM_TRAILING_PARAMS(n, class t) >   /*error C2913: explicit specialization; 'typelist1' is not a specialization of a class template*/ \
struct typelist##n \
{ \
    typedef t##n e##n; /*I want n of these*/ \
};

#define Type_At(list, element) list::e##element

#define BOOST_PP_LOCAL_LIMITS (1, 5)

#include BOOST_PP_LOCAL_ITERATE()

See the comments in the code of the issues. Is this a decent way to go about making a typelist? It seems…. dirty. I only just heard about the concept of a typelist, so I’m not familiar with different flavors.

Solution:

#define BOOST_MPL_LIMIT_VECTOR_SIZE  50
#include <boost/mpl/vector.hpp>
#include <boost/mpl/at.hpp>

typedef boost::mpl::vector<int, float, double, long, short> vecType;
boost::mpl::at_c<vecType, 3>::type hi = 3;
  • 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-06-02T01:45:31+00:00Added an answer on June 2, 2026 at 1:45 am

    Maybe you could try boost::mpl::vector. (I can’t quite see what were you trying to do).

    If you could use c++11, making a typelist is much easier with variadic templates (meaning no nasty preprocessor stuff).

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

Sidebar

Related Questions

I have an AsyncTask that is executed before I move on to the next
In Linux, Is there any command to move all sub directories created before a
before this I wrote all jquery-code into main fail. Now I want to move
I had never had this error before, and I didn't move any file, or
Before Django 1.0 there was an easy way to get the admin url of
Before you start flaming, I'm going to tell you that I am trying to
Before someone said that I did not read I may say that I read
I want to move a directory and all of its subdirectories with Directory.Move. Before
I'm suspecting the answer is no, but I just want confirmation before I move
I'm trying to move items in my list but when I compare against the

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.