boost-preprocessor Questions
15
Solved
I am trying to figure out what version of Boost my code thinks it's using. I want to do something like this:
#error BOOST_VERSION
but the preprocessor does not expand BOOST_VERSION.
I know I cou...
Irredeemable asked 13/10, 2009 at 18:26
7
Solved
Not sure what to make of this error. Added -D_WIN32_WINNT=0x0501 to Visual Studio's "Command Line" options under Project Properties but it says it doesn't recognize it and the warning still appears...
Woe asked 8/6, 2010 at 18:38
4
Solved
I want to implement a new max/min macro, which can take more than two parameter, for example:
#define max( ... ) ...
and then, I can use it like this:
max( p0, p1, p2, p3 )
max( 2, 4, 100 )
max...
Underdone asked 1/4, 2014 at 1:42
3
Solved
Is there any way in standard C—or with GNU extensions—to append stuff to a macro definition? E.g., given a macro defined as
#define List foo bar
can I append bas so that it List expands as if I’d d...
Homoiousian asked 28/12, 2010 at 22:34
3
Solved
Is it possible to write a function-like C preprocessor macro that returns 1 if its argument is defined, and 0 otherwise? Lets call it BOOST_PP_DEFINED by analogy with the other boost preprocessor m...
Aman asked 3/12, 2016 at 4:34
1
Solved
I have a macro defined which is
#define TYPES (height,int,10)(width,int,20)
How to expand this macro using Boost Preprocessor something like this?
int height = 10;
int width = 20;
at most i...
Kath asked 29/9, 2016 at 9:9
4
Solved
I would like to have include file paths dynamically created by a macro for a target-configuration-dependent part of my program.
for example, I would like to construct a macro that would be invoked...
Snider asked 18/8, 2015 at 7:30
4
Solved
After discovering the Boost preprocessor's capabilities I found myself wondering: Is the C99 preprocessor Turing complete?
If not, what does it lack to not qualify?
Sipes asked 28/6, 2010 at 22:45
3
Solved
I am trying to write an application that is loading its extensions dynamically during runtime. I used Boost Preprocessor library to write a preprocessor function that, given a list of names, declar...
Shinny asked 24/6, 2012 at 6:16
1
Is it possible to create compile time constants like this:
// event.h
#define REGISTER_EVENT_TYPE() ... // Returns last_returned_number+1
// header1
#define SOME_EVENT REGISTER_EVENT_TYPE()
// h...
Cinderella asked 25/2, 2015 at 16:28
2
Solved
How to use boost::preprocessor to unzip a sequence of pairs?
For example, I have a sequence as below (comma between doesn't matter)
(int,x)(double,y)(float,z) or
(int,x),(double,y),(float,z) or
(...
Nikkinikkie asked 20/10, 2014 at 21:44
1
Solved
I'm already most of the way there:
#include <boost/preprocessor.hpp>
#define COUNT(...) BOOST_PP_VARIADIC_SIZE(__VA_ARGS__)
COUNT(1,2,3)
COUNT(1,2)
COUNT(1)
COUNT()
Running this with -E fl...
Standridge asked 8/8, 2014 at 8:10
1
Solved
For some classes we can define macros which does explicit template specialization as the folllowing example from Boost Serialization library:
#define BOOST_IS_BITWISE_SERIALIZABLE(T) \
namespace b...
Takara asked 30/5, 2014 at 3:42
1
Solved
#include <type_traits>
#include <iostream>
using namespace std;
// Expand
#define PP_EXPAND(X) X
// Counter Arguments count
#define PP_ARG_COUNT(...) PP_EXPAND( PP_ARG_POPER(__VA_ARG...
Angular asked 31/3, 2014 at 6:9
1
Solved
I have struct like :
struct E1
{
typedef boost::tuple<
boost::optional< N::type_A >, // N - namespace
boost::optional< N::type_B >,
...................
boost::optional< N::...
Underfeed asked 26/8, 2013 at 9:58
1
Solved
I wonder if it is possible using boost::mpl/preprocessor or some noce C++11 features to create function proxy from class type and function name.
Say we had:
inline void set_email(const ::std::st...
Intermarriage asked 10/12, 2012 at 11:53
1
Solved
My (relatively old) C++ compiler choked on this file in Boost, which starts out as:
# /* Copyright (C) 2001
# * Housemarque Oy
# * http://www.housemarque.com
# *
# * Distributed under the Boost So...
Maggy asked 11/8, 2012 at 7:24
2
Solved
To preface this question: I've been implementing various C++ utility functions and (when I have to) macros in a larger toolkit for my own use. Recently I had been making a variety of loop macros ba...
Paestum asked 31/7, 2012 at 4:59
3
Solved
In my previous question I asked is recursive explicit template instantiation possible. I saw that it is indeed possible; however, this instantiation turns out to be effective locally only, the symb...
Anthony asked 13/9, 2011 at 8:35
4
Solved
I am trying to figure out how to use the Boost.Preprocessor library http://www.boost.org/doc/libs/release/libs/preprocessor to unfold a "generic" type for different specific types. Below I will ask...
Galbanum asked 8/2, 2010 at 15:59
1
Solved
I'm trying to do some kind of Macro "Overloading", so that MACRO(something), gets expanded differently than MACRO(something, else).
Using a snippet I got from here (I'm not sure if it's 100% porta...
Holeandcorner asked 6/8, 2010 at 1:40
1
© 2022 - 2024 — McMap. All rights reserved.