templates

Is it possible to prompt the user for information in a Visual Studio template?

Is it possible to prompt the user for more than just a file name when they create a new item from a Visual Studio 2005 template? It would be nice to have more than just the class's name filled in when a template is used. ...

Stringifying template arguments

Is it possible in C++ to stringify template arguments? I tried this: #define STRINGIFY(x) #x template <typename T> struct Stringify { Stringify() { cout<<STRINGIFY(T)<<endl; } }; int main() { Stringify<int> s; } But what I get is a 'T', and not an 'int'. Seems that the preprocessors kicks in before tem...

Django inclusion tag with configurable template

I've created an inclusion tag, however I'd like to be able to make the template optionally configurable. There doesn't seem to be support for this out of the box, so I'd like to see how people did this - maybe a method search the templates directory first for a specific template name and then falling back to the default template. @regis...

Easiest CMS to customize its User Interface ?

Hello guys, I'm actually working in a university-related project where the users would generate the site's content (quite a lot of searcheable static pages), having at the same time a profile's page, that the other users could see. As I work usually with WordPress, I though that I could make use of WordPress Multi User, but I found a b...

Is it possible to generate types with all combinations of template arguments?

I have a templated class template<class U, class V, class W> class S { //... implementations }; and some stock type implementations for type U, V and W: typedef boost::mpl::vector<U0, U1> u_types; typedef boost::mpl::vector<V0, V1, V2, V3, V4> u_types; typedef boost::mpl::vector<W0, W1, W2, W3, W4> w_types; I want to test class S...

c++ templates: header files still broken?

It used to be that to use a template class in C++, the implementations had to be in the header file or #included into the header file at the bottom. I've not used C++ templates for a few years; I just started using them again and observed that this behavior seems to persist. Is this still the case? Or are the compilers smart enough now...

How to template in PHP... the right way???

I'm starting to understand the importance of templating in PHP. I'm using PHP itself as a template engine to avoid learning any new language. I'm still not clear on one thing tho, although I have an idea about it. I would like to know what the experts do. Should I create a full page template, with all tables, forms and everything else (...

Default template parameters arguments in VC++

Does VC++ not support default template parameters arguments? This simple code: template <typename T=int> class X { }; X x; gives me an 'error C2955: 'X' : use of class template requires template argument list'. No complaints about the template declaration, however. What am I missing here? Some compiler switch maybe? ...

How to cast template class ptr to normal class ptr in C++

Hello, I have question regarding macros. How could I cast through macro a template class to normal class. In example: #define RUNTIME_CLASS(class_name) ((CRuntimeClass*)(&class##class_name)) template<typename T> A {}; if (RUNTIME_CLASS(A)); I know that this code woun't compile because it will not see template bit. But I don't unders...

Templates in Dreamweaver

How to use templates in dreamweaver ? Can somebody help me regarding this ? ...

A pointer to abstract template base class?

Dears, I cannot figure this out. I need to have an abstract template base class, which is the following: template <class T> class Dendrite { public: Dendrite() { } virtual ~Dendrite() { } virtual void Get(std::vect...

Overriding method of an element within a XAML UserControl?

I have a Silverlight user control that has no template and does not need one as it is simply a path with a RectangleGeometry that is resized by code. Now our designed has added a template to the tooltip of the path and I want to be able to provide a method for users of the control to change the layout of a portion of this template. If th...

left trim white space xslt 1.0

I am creating a left trim template and I have this below template: <xsl:template name="str:left-trim"> <xsl:param name="string" select="''"/> <xsl:variable name="tmp" select="substring($string, 1, 1)"/> <xsl:if test="$tmp = ' '"> <xsl:variable name="tmp2" select="substring-after($string, $tmp)"/> <xsl:choose...

VS2008 Project templates

Hi, I have created vs 2008 web application project. this project has image files which are excluded from the project. I made project template of the web application project and when I create a new project of the template, excluded files are not copied over. is it possible to have excluded files get copied over when you create a projec...

Use a Graph Library/Node Network Library or Write My Own?

I'm trying to decide between going with a pre-made graph/node network library or to roll my own. I'm implementing some graph search algorithms which might require some significant customization to the class structure of the node and/or edges. The reason I'm not sure what to do is that I'm unsure if customization of a pre-made might be...

How can I include PHP in a vBulletin style?

I'd like to use PHP in a vBulletin style/skin, yet when I do so, the PHP doesn't work. By 'not work', I mean it's treated just as plain text. And if you look in the code you can see the PHP code (hidden, by Firefox - which is the behaviour you get if you put PHP code on a plain html page) http://vapurl.com/h0kp3fqr8c - view source, and...

Is there a Visual Studio (or freeware) equivalent for Expression Blend's "Edit Template" feature?

In Expression Blend, you can view and edit the control template of objects in the "Objects and Timeline" panel. I'm wondering if there's an equivalent feature in Visual Studio or if there's something free (or very inexpensive) I can download that will allow me to do this. Here's a screen cap from Expression Blend that shows what I'm tal...

C++ Templates type casting with derivates

Hi, I'm trying to cast from one generic to another, say: myClass<MoreAbstract> anItem = myclass<DerivateFromMoreAbstract> anotherObject; Or do something like aFunction(anotherObject); // myclass<DerivateFromMoreAbstract> anotherObject where aFunction signature is aFunction(myClass<MoreAbstract> item); In fact, myClass is actual...

Template specialization of particular members?

Is it possible to specialize particular members of a template class? Something like: template <typename T,bool B> struct X { void Specialized(); }; template <typename T> void X<T,true>::Specialized() { ... } template <typename T> void X<T,false>::Specialized() { ... } Ofcourse, this code isn't valid. ...

Problems with my Rabbit Hole templates?

Hi, there Today I've stepped into a problem I thought was so common I got myself wondering why only now I've noticed it. Imagine you have a class you want to handle using a boost::shared_ptr<>. This class has members that must forward shared_ptr<>s of itself to other methods; in other words, it has to create a shared_ptr<>s to the this ...