Hi,
I have a little problem in C++ I don't know how to solve.
The first part of the problem is to access an element in a struct via [], or better, to map [] to a subelement.
My struct looks like this:
struct e {
std::string content;
std::string name;
std::map<std::string, std::vector<e> > elements;
};
If I want to access ...
Hi All I have master DataGrid and detail DataGrid. I need a arrow beatween them align to selected row in master?
[ Master ] [ Detail ]
[ row ] [ row ]
[ row ] [ row ]
[ selected row ] > [ row ]
[ row ...
I am getting the below mentioned error, when i try to use the xml code from here.
The template is not mine, but a friend's. I am trying to use the same for my blog.
Please let me know what is the error.
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message:...
$14.6.2/3 - "In the definition of a class template or a member of a class template, if a base class of the class template depends on a template-parameter, the base class scope is not examined during unqualified name lookup either at the point of definition of the class template or member or during an instantiation of the class template o...
I've been trying to send an email from my magento module but for some reason I can't get the template to work:
The template is set as follows:
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('application_status_email');
The headers and all are being sent correctly.
I've created a file called application_status_e...
Hello,
Let's say I have two categories.
I want first category to use template/catalog/list_a.phtml, but I want second category use template/catalog/list_b.phtml for their product listing template. I also like first category to use template/catalog/view_a.phtml and second category to use template/catalog/view_b.phtml.
I found a solutio...
I have two structs:
// ----- non-const -----
struct arg_adapter
{
EArgType type; // fmtA, fmtB, ...
union
{
TypeA * valueA;
TypeB * valueB;
// ... more types
}
arg_adapter(TypeA & value) : type(fmtA), valueA(&value) {}
arg_adapter(TypeB & value) : type(fmtB), valueB(&v...
Why is the following code not compiling and how would it be possible to use the function from the base class?
template<typename K> struct Base
{
K foo() { return (K)0; }
};
template<typename K> struct Extension
: public Base<K>
{
K foo(int a) { return (K)a; }
};
int main()
{
Extension<float> e;
e.foo();
return 0;
}...
I wrote my first ever C++ template code on expandable array and I am getting a segmentation fault! After an hour of debugging I have realized that I need help. Something is wrong with the constructor or the destructor I think but not sure.
The code is on pastie ready to be compiled.
http://pastie.org/1150617
/* Expandable array in C++ ...
I wrote the following code on VC10. Calling f1 is okay, but on calling f2 the compiler showed an error. The difference between the two functions is only "template ", but the template type is actually not used. Why does the error occur?
#include <functional>
void f1( std::tr1::function<void()> f)
{
}
template <typename >
void f2( std::...
When can you omit the C++ template argument list? For example in Visual Studio 2010 this piece of code compiles fine:
template<class T>
Vec2<T> Vec2<T>::operator+ (const Vec2 &v) const
{
return Vec2(x + v.x, y + v.y);
}
If you inline the code, it actually compiles without any argument list. But is this really the same as the follo...
I have flyweight pattern. I have abstract class Glyph. I have class Letter and abstract Code derived from Glyph. I have YusciiCode, UniCyrCode and UniLatCode derived from Code.
My flyweight factory can be done like this:
template <class T>
class CodeFactory : public AbstractCodeFactory
{
public:
CodeFactory();
virtual ~Code...
Hello guys.
I trying to make Blogspot.com like XML template engine with php. And I'm newbie in XML. How could make php script that read this type of XML and print out something to user's browser?
I want to use too many free blogspot templates. Thank you.
....
<b:if cond='data:blog.con0'>
blablabla1
<b:if cond='data:b...
What is wrong with the following piece of code?
template<typename X>
struct A {
template<int N>
int foo() const {
return N;
}
};
template<typename X>
struct B {
int bar(const A<X>& v) {
return v.foo<13>();
}
};
#include <iostream>
using std::cout;
using std::endl;...
Learning C++, came upon function templates. The chapter mentioned template specialization.
template <> void foo<int>(int);
void foo( int );
Why specialize when you can use the second? I thought templates were suppose to generalize. What's the point of specializing a function for a specific data type when you can just use a regular fu...
Hi,
I just installed Joomla on my pc. Everything works just fine. I installed a lot of templates and they all worked, but the template i really want to use doesn't.
I want to use this template: http: //byjoomla.com/docman/bj-joomla-templates/bj-venus/download.html
The result would have to be like this.
When I installed Joomla i clicke...
I have a chess variants engine that plays suicide chess and losers chess along with normal chess. I might, over time, add more variants to my engine. The engine is implemented completely in C++ with proper usage of OOP. My question is related to design of such a variant engine.
Initially the project started as a suicide-only engine whi...
I search template engine for PHP that's almost similar to the Django template.
...
Hello!
When I'm writing a simple (non-template) class, if the function implementation is provided "right in place", it's automatically treated as inline.
class A {
void InlinedFunction() { int a = 0; }
// ^^^^ the same as 'inline void InlinedFunction'
}
What about this rule when talking about template-based classes?
template <...
I'm trying to compare between the different template engines for PHP. The 2 that come up are smarty and PHPtemplate. How do I decide which is better for me.. These are some of the questions I'm trying to find answers to
What are some of the strengths and weaknesses of these 2
Is one better than the other in some cases or for some typ...