I have a set of callback classes that I use for handling callbacks with variable numbers of parameters. Right now I have about 6 different instances of it to handle differing numbers of arguments. Is there a way to make one instance than can handle a variable number of arguments?? Ultimately I would love to have each parameter be a POD t...
Freemarker, Tiles oder Velocity? Which template engine is the best for a multi-user-system build with struts?
...
Hi,
What's the most elegant templating (preferably in pure PHP!) solution you've seen?
Specifically i'm interested in handling:
Detecting in a repeating block whether it's the first or last element
Easy handling of odd/even cases, like a zebra striped table, or similar
Other modulos logic, where you'd do something every n'th time.
...
Hi All, I'm using CodeSynthesis XSD C++/Tree Mapping utility to convert an existing xsd into c++ code we can populate the values in. This was we always make sure we follow the schema.
After doing the conversion, I'm trying to get it to work so I can test it. Problem is, I'm not used to doing this in c++ and it's my first time with thi...
The following code:
template <typename S, typename T>
struct foo {
void bar();
};
template <typename T>
void foo <int, T>::bar() {
}
gives me the error
invalid use of incomplete type 'struct foo<int, T>'
declaration of 'struct foo<int, T>'
(I'm using gcc.) Is my syntax for partial specialization wrong? Note that if I remove the...
It looks like I had a fundamental misunderstanding about C++ :<
I like the polymorphic container solution. Thank you SO, for bringing that to my attention :)
So, we have a need to create a relatively generic container type object. It also happens to encapsulate some business related logic. However, we need to store essentially arbitr...
In a related question I asked about creating a generic container. Using polymorphic templates seems like the right way to go.
However, I can't for the life of me figure out how a destructor should be written. I want the owner of the memory allocated to be the containers even if the example constructor takes in an array of T (along with ...
I am looking for a template engine to use client side. I have been trying a few like jsRepeater and jQuery Templates. While they seem to work OK in FireFox they all seem to break down in IE7 when it comes down to rendering HTML tables.
I also took a look at MicrosoftAjaxTemplates.js (from http://www.codeplex.com/aspnet/Release/ProjectRe...
Which Template-/Ajax-Framework is able to load information of various web application modules (JAR-Files)?
...
Hi,
Usually I'm fortunate enough to work with really good designers. They take care of the look and feel for all of the web applications / sites I build.
In the past when I've done cheap or free work for people for projects I'm interested in, I've used a template from templatemonster or similar.
I want to get involved with quite a la...
I've been programming in C++ for a few years, and I've used STL quite a bit and have created my own template classes a few times to see how it's done.
Now I'm trying to integrate templates deeper into my OO design, and a nagging thought keeps coming back to me: They're just a macros, really... You could implement (rather UGLY) auto_ptrs...
I want to use a template engine in a struts application and would like to know if using TILES can be recommended instead of FREEMARKER or VELOCITY.
...
Which Template-Engine and Ajax-Framework/-Toolkit is able to load template information from JAR-Files?
...
I have a C++ template class that gets instantiated with 3 different type parameters. There's a method that the class needs to have for only one of those types and that isn't ever called with the two other types.
Will object code for that method be generated thrice (for all types for which the template is instantiated), or is object code...
Several times now I've had Eclipse delete files for me seemingly randomly - then they appear under the 'Local History' option.
What is going on! I'm definitely not just deleting things by mistake.
Most recently it deleted my template files under html-template which are quite important!
I have an AIR project and a web project that ref...
What ReSharper 4.0 templates for C# do you use?
Let's share these in the following format:
[Title]
Optional description
Shortcut: shortcut
Available in: [AvailabilitySetting]
// Resharper template code snippet
// comes here
Macros properties (if present):
Macro1 - Value - EditableOccurence
Macro2 - Value - EditableOccurence
...
I'm told that the template system in C++ is Turing-complete at compile time. This is mentioned in this post and also on wikipedia.
Can you provide a nontrivial example of a computation that exploits this property?
Is this fact useful in practice?
...
I saw Scott Meyers' "Effective C++" third edition book having a small section on "Template Programming".
Any other book/links containing information on "effective" usage of templates ?
...
For some reason, my visual studio 2008 installation doesn't have the "Create Test Project" template installed. I'm assuming I should be able to download it from somewhere on MSDN, but I cannot find it anywhere (Guess my Google-Fu is weak)
Does anyone know where I can get the template to install it?
Thanks
EDIT: I've managed to get my ...
Assume I have a function template like this:
template<class T>
inline
void
doStuff(T* arr)
{
// stuff that needs to use sizeof(T)
}
Then in another .h filee I have a template class Foo that has:
public: operator T*() const;
Now, I realize that those are different Ts. But If I have a variable Foo<Bar> f on the stack, the only way ...