templates

Use of declarations in C++ templates?

In a template-declaration, explicit specialization, or explicit instantiation the init-declarator-list in the declaration shall contain at most one declarator. When such a declaration is used to declare a class template,no declarator is permitted. Any one explain this ? For me it is necessary that i need to check the compilers is foll...

Referencing a member of a member in template

I'm using boost::multi_index_container and I'm trying to refer to a member of a member in a template argument, but it's unclear how to do this: struct Foo { int unique_value; }; struct Bar { Foo foo; double non_unique_value; }; // I want to refer to some_value in a template argument: multi_index_container<Bar, boost::multi...

Creating a template predicate class requiring a pointer to method function, and ensuing compiler errors

I'm building a series of predicates that duplicate lots of code, and so are being changed into a single template function class based on the std::unary_function. The idea is that my class interface requires methods such as Element_t Element() and std::string Name() to be defined, so the predicate template arguments are the object type an...

Useful Resharper Live Templates?

What are some useful live templates for Resharper that you use on a daily basis? ...

C++ overloaded function pointer

hello I am not able to get this to work: template<class Input, class Output, class Index> size_t pack(void (*copy)(Input, Input, Output), size_t N, Input input, Output output, const Index &index); size_t K = pack(&std::copy<const double*,double*>, M, C.data().begin(), C_.data().begin(), ...

Change ticket diskplay in Trac

With default template, trac ticket is available for viewing only, I must click modify to expand properties tab to modify, change state of a ticket. Now I want to expand that tab automatically? How can I change it quickly without changing the template itself? Is it possible to change it with trac.ini file? I cannot find where's location ...

template External Linkage ?can anyone Explain this?

I know about external linkage using the keyword extern "C" EX : extern "C" { template<class T> class X { }; } but they gave template shall not have a C linkage can any one explain this ? ...

Which compiler for default templates args in function

Hi, Is there a compiler which would complile function template definition with new C++ feature namely default templates arguments in function definition? ...

static initialization of Template classes for singleton object

Hi, We have a singleton template class as defines below template<class T> class Singleton{ T& reference(){ return objT; } private: T objT; }; And another user defined class which uses this singleton class TestClass{ static Singleton<TestClass> instance; static TestClass * getPointer() ...

Specifying template argument

How can I specify what is required to be a valid template argument? What I mean is let's for example take something like this: template<class T> void f(const T& obj) { //do something with obj } but I would like T to be only integer type so I would accept char, int, short unsigned etc but nothing else. Is there (I'm sure there is) a w...

Create a template for iPhone projects in XCode?

How do I create another project template in XCode? I want to make another one which will include all of my libraries and have the correct headers and frameworks added. ...

C++ standard on export of Templates, can any one explain it ?

A namespace-scope declaration or definition of a non-inline function template, a non-inline member function template, a non-inline member function of a class template or a static data member of a class template may be preceded by the export keyword. If such a template is defined in the same translation unit in which it is de...

How to edit email templates without the mail editor plugin?

I've installed the mail editor module for drupal in order to edit the templates for emails that my site sends out and I get this message after enabling the module: "This version is incompatible with the 6.16 version of Drupal core." How do I work around that? Do I just keep trying older versions of the plugin or is there another plugin I...

CGAL half-edge data structure

Hello, I am trying to learn how to use half-edge data structures in CGAL, and I am confused by the following sample of code provided on their website #include <CGAL/HalfedgeDS_default.h> #include <CGAL/HalfedgeDS_decorator.h> struct Traits { typedef int Point_2; }; typedef CGAL_HALFEDGEDS_DEFAULT<Traits> HDS; typedef CGAL::HalfedgeDS...

MSVC 2010 templates compiler problem

1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\list(1194): error C2451: conditional expression of type 'void' is illegal 1> Expressions of type void cannot be converted to other types 1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\list(1188) : while compiling class template member fu...

How do I give Symfony templates a CSS class based on their navigation path

I am trying to render templates in Symfony with a CSS class to denote which part of the site they belong to. For example: I am in /games I'd like the page to look something like: <div id="wrapper" class="games"> <!-- content --> </div> Or if we are displaying /home/profile the page would look like this: <div id="wrapper" class="home...

Building a dynamic tree with session information in Django (template question)

Hi, So I've got a expanding/collapsing tree that I'm keeping track of in session data. I want to be able to render the tree in Django based upon the session data. I am saving the state with something like: request.session['treedata'][item_id] = state # (0 or 1) In my template for rendering, I'm looping through the items and for e...

Templates .?Any one explain this ?

A non-exported template that is neither explicitly specialized nor explicitly instantiated must be defined in every translation unit in which it is implicitly instantiated; no diagnostic required. Can any one explain this? actual point is from ISO standard 14th chapter 14.0 ,point 8 ...

Silverlight 4.0 Accordion Template

Hi, Is their a free template of accordion which behaves like Outlook? When the user adjusted its grid, the accordion item will form an images, stack horizontally? Thank you in advance ...

Focus on Label, TextBlock and Border

Hi I want to create a flat button with rounded right top and bottom corners. This button needs to have the background changed on clicked and on mouse over. Currently my Markup looks like this: <Border x:Name="MyButton" Height="25" Margin="0,5,0,0" CornerRadius="0 5 5 0" BorderThickness="1" BorderBrush="Gray" Style="{StaticResource...