derp-cpp

0.0.3 • Public • Published

derp-cpp NPM version

String interpolation for clang++ - Yet another post-pre processor

Install globally with npm:

npm i -g derp-cpp

General help

Usage:
    derp -
    derp -h | --help 

Description:
    Expands C++ interpolated strings from a program read from stdin. Produces the manipulated program on stdout.

This is just a post processor to be run after clang++ preprocessor (-E option).

Example

Assume the following c++ file (example.cxx):

#include <string>
#include <iostream>
 
auto s = "variable string";
 
int main()
{
    std::cout << "This is an interpolation of '#{s}' that goes to stdout\n";
}
 

Compile it with:

> clang++ --std=c++11 -E example.cxx | derp > example.c++ &&  clang++ -o example --std=c++11 example.c++

And then run it:

> ./example 
This is an interpolation of 'variable string' that goes to stdout

Author

Vittorio Zaccaria

License

Copyright (c) 2014 Vittorio Zaccaria
Released under the BSD license


This file was generated by verb on December 18, 2014.

Readme

Keywords

none

Package Sidebar

Install

npm i derp-cpp

Weekly Downloads

1

Version

0.0.3

License

BSD

Last publish

Collaborators

  • vzaccaria