I have the following code:
template <typename Provider>
inline void use()
{
typedef Provider::Data<int> D;
}
Where I'm basically trying to use a template class member 'Data' of some 'Provider' class, applied to 'int', but I get the following errors:
util.cpp:5: error: expected init-declarator before '<' token…
Hi!
I am looking for a stand-alone, easy to use from C# code, template engine.
What I want to do is create an html and xml files with placeholders for data,
and fill them with data from my code.
The engine needs to support loops (duplicating parts of the template form more that one object) and conditions (add parts of the template…
I'm using drupal 6. I've managed to make a .tpl file for one content type, that is for images in my image gallery. I did that by adding this code in template.php:
function artbasic_theme($existing, $type, $theme, $path) {
return array(
'galleryimage_node_form' => array(
'arguments' => array('form' => NULL),
…
Hi,
My full code is too long, but here is a snippet that will reflect the essence of my problem:
class BPCFGParser {
public:
...
...
class Edge {
...
...
};
class ActiveEquivClass {
...
...
};
class PassiveEquivClass {
...
...
};
struct EqActiveEquivClass {
...
...
};
…
I have a UserControl with template property on, and a listView where i want to bind my collections.
I use them for a multiple window interface.
How can i bind on several different windows (child template), different collection which are updated in real time. My example is for a sniffer with multiple interfaces packet capturing.…
I'm using the date plugin for Template::Toolkit (Template::Plugin::Date), it works well with datetimes (yyyy-mm-dd hh:mm:ss) pulled straight out of MySQL, but it will not work with dates (yyyy-mm-dd).
What's the simplest way to get date.format to accept dates (without modifying the sql query)?
Thanks.
I am writing matrix classes. Take a look at this definition:
template <typename T, unsigned int dimension_x, unsigned int dimension_y>
class generic_matrix
{
...
generic_matrix<T, dimension_x - 1, dimension_y - 1>
minor(unsigned int x, unsigned int y) const
{ ... }
...
}
template <typename T,…
if a have a declaration like
theclass = Classroom.objects.get(classname = classname)
members = theclass.members.all()
and i want to display all the members(of a class) in a template, how should i do it??
if i write:
{{theclass.members.all}}
the output is an empty list(though the class has some…
I'm kind of falling in love with Node.js not because you write app code in javascript but because of its performance.
I really don't care a lot about how beautiful a server side language might be but how much requests per second it can handle.
So anyway I'm looking forward to experiment building an entire webapp…
Is it possible to get a stringified version of a template argument name?
Something like this, if only we were running the preprocessor:
template <typename T>
struct Named{
const char* name(){ return "Named<" #T ">"; }
};
Very similar to this post
How can I declare template array as a parameter in templated function?
Something like this code:
template <unsigned i> void my_func (char (&a)[i]); //yes, I do need that reference
This is my template matrix class:
template<typename T>
class Matrix
{
public:
....
Matrix<T> operator / (const T &num);
}
However, in my Pixel class, I didn't define the Pixel/Pixel operator at all!
Why in this case, the compiler still compiles?
I am trying to write an operator which converts between the differnt types of the same implementation. This is the sample code:
template <class T = int>
class A
{
public:
A() : m_a(0){}
template <class U>
operator A<U>()
{
A<U> u;
u.m_a = m_a;
…
I have a simple object that has as one of it's properties a decimal named Amount. When I attempt a comparison on this property as part of an nVelocity template, the comparison always fails. If I change the property to be of type int the comparison works fine. Is there anything extra I need to add to the…
Pretty sure there is an easy answer to this, but just can't find the right VTL syntax.
In my context I'm passing a Map which contains other Maps. I'd like to reference these inner maps by name and assign them within my template. The inner maps are constructed by different parts of the app, and then…
Hello there,
Could it be possible if somebody could help me get started in writing a python template engine? I'm new to python and as I learn the language I've managed to write a little MVC framework running in its own light-weight-WSGI-like server.
I've managed to write a script that finds and…
Hi there,
I'm trying to write a container class using boost::ptr_vector. Inside the ptr_vector I would like to include different classes. I'm trying to achieve that using static templates, but so far I'm not able to do that. For example, the container class is
class model {
private:
…
I have a problem with a template and pointers ( I think ). Below is the part of my code:
/* ItemCollection.h */
#ifndef ITEMCOLLECTION_H
#define ITEMCOLLECTION_H
#include <cstddef>
using namespace std;
template <class T> class ItemCollection
{
public:
//…
I have been learning about T4 templates recently by looking at the awesome ADO.NET POCO entity generator. By using the POCO entity generator template as a base, I created a T4 template which generates metadata classes for a given Entity Data Model. This speeds coding by reducing the…
I've written a (array) container class template (lets call it smart array) for using it in the BREW platform (which doesn't allow many C++ constructs like STD library, exceptions, etc. It has a very minimal C++ runtime support); while writing this my friend said that something like…
I've written a (array) container class template (lets call it smart array) for using it in the BREW platform (which doesn't allow many C++ constructs like STD library, exceptions, etc. It has a very minimal C++ runtime support); while writing this my friend said that something like…