Custom File Template for C++
It looks like the file template feature doesn't like c++ preprocessor directives. This is what happens when I add some of them to the template:
#include "something" -> the #include disappears when the file is created from template, so I get a line with just "something"
#define SOMETHING something -> As long as there is #define, when I try to create a file from the template, the generation will fail with the following error message:
Unable to parse template "C++ Test"
Error message: unknown error
For now I work around the issue removing the letter "e" from the directives, Is there a proper way to create a c++ template? The premade header doesn't seem to have issues with #define, so I would assume there is one.
Thanks
Please sign in to leave a comment.
#[[#include]]# <iostream>
using namespace std;
int main(){
}
Yes, there is the #[[don't parse me!]]# syntax in Apache Velocity template language which is used for templates.