|
Boost : |
Subject: Re: [boost] Interactive metaprogramming shells
From: Larry Evans (cppljevans_at_[hidden])
Date: 2014-01-26 12:55:00
On 01/26/14 05:21, Abel Sinkovics wrote:
> Hi,
>
> I've built interactive shells for preprocessor and template
> metaprogramming. I've been using them for development and debugging of
> metaprograms and I think Boost developers could also find them useful.
>
> You can type in (metaprogramming) expressions which get evaluated and
> the result is displayed immediately. For example you can type
>
> boost::mpl::push_front<boost::mpl::vector<int, char>, double>::type
>
> and you get
>
> boost_::mpl::vector<double, int, char>
>
> as the result (the boost_ namespace is used because there are some
> tricks there to make the output more readable).
>
>
> As an example for the preprocessor shell you can type
>
> BOOST_PP_REPEAT(3, foo BOOST_PP_TUPLE_EAT(3), ~)
>
> and you get
>
> foo foo foo
>
> as the result.
>
>
> The tools are based on the Boost.Wave library and Clang. You can get
> them here:
> Preshell for preprocessor: https://github.com/sabel83/preshell
> Metashell for template metaprograms:
> https://github.com/sabel83/metashell
>
> You can also try them from your browser here: http://abel.web.elte.hu/shell
>
> Feedback is welcome.
>
> Regards,
> Ábel
>
FANTASTIC!
I tried the above example in my ubuntu Konqueror browser and it worked
as expected:
/*
* Template metaprogramming shell 1.0.0
* 9f2271f Keep link path at install
*
* Metashell Copyright (C) 2013 Abel Sinkovics (abel_at_[hidden])
* This program comes with ABSOLUTELY NO WARRANTY. This is free
software, and you are welcome to redistribute it
* under certain conditions; for details visit
<http://www.gnu.org/licenses/>.
*
* Based on
* libclang Debian clang version 3.2-7ubuntu1
(tags/RELEASE_32/final) (based on LLVM 3.2)
* Boost.Wave 2.3.0.4421 [linux/GNU C++ version 4.8.1]
* Readline 6.2
*/
> #include <boost/mpl/vector.hpp>
> #include <boost/mpl/push_front.hpp>
> #include <metashell/formatter/vector.hpp>
> boost::mpl::push_front<boost::mpl::vector<int, char>, double>::type
boost_::mpl::vector<double, int, char>
>
Thank you very much Abel.
-kind regards,
Larry
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk