My disclaimer here is that I started teaching myself C++ about a week ago and my former experience with programming has been with dynamic languages (Python, javascript).
I'm trying to iterate though the contents of a vector using a generic function to print out the items:
#include <iostream>
#include <algorithm>
#include <vector>
usin...
I have a class whose functionality I'd like to depend on a set of plug-in policies. But, I'm not sure how to get a class to derive from an arbitrary number of classes.
The code below is an example of what I'm trying to achieve.
// insert clever boost or template trickery here
template< class ListOfPolicies >
class CMyClass : public L...
I'd like to throw together a basic Netbeans editor with syntax highlighting for a non-standard database language.
Initial target: highlight a set of reserved words and standard C multi-line comments.
Anyone savvy with this and could point me to a link, or a template?
One last thing: I've pulled down the Netbeans source tree before and...
Ive got a problem that if I have a template class, which in turn has a template method that takes a parameter of another instance of the class (with different template arguments), that it can not access protected or private members of the class passed as a parameter, eg:
template<typename T>class MyClass
{
T v;
public:
MyClass(T...
In the Sinatra ruby framework, I have a route like this:
get '/portfolio/:item' do
haml params[:item].to_sym
end
This works great if the template that exists (e.g., if I hit /portfolio/website, and I have a template called /views/website.haml), but if I try a URL that doesn't have a template, like example.com/portfolio/notemplate, I...
On occasion I've seen some really indecipherable error messages spit out by gcc when using templates... Specifically, I've had problems where seemingly correct declarations were causing very strange compile errors that magically went away by prefixing the "typename" keyword to the beginning of the declaration... (For example, just last w...
I have a class that uses an "add-on" template to add additional functionality as below:
template< class T >
class AddOn_A
{
public:
int SomeFuncA()
{
T* pT = static_cast< T* >( this );
return pT->DoSomething() + 1;
};
};
class CMyClass : public AddOn_A< CMyClass >
{
public:
int DoSomething()
{
...
Brand new to CMS:
With Joomla or other CMS, If I want to use my own design, do I have to make it a template first using proprietary code of some sort = ie using some Joomla templating language - or is using my own design with Joomla simple and independent?
I am not sure the role "templates" play with Joomla and other CMS. I gather they...
I have a decorator-like pattern with a base that requires a constructor parameter. The decorator is constructed such that it can take an arbitrary number of add-on components as template parameters (up to 3 in this example).
Unfortunately, I can't figure out how to pass the base's constructor parameter to it when more than one add-on is...
I'm building a website, it allow user edit their website template, so i need a template engine for asp.net web form (im using C#). I'm worry about security problem, about user can write some c# code. So any template engine recommended?
...
I just came across std::tr1::extent template and it puzzled me. I never ever dealt with array type parameters in my life so I don't understand how they work. So, given the code from gcc type_traits
template<typename _Tp, unsigned _Uint, std::size_t _Size>
struct extent<_Tp[_Size], _Uint>
template<typename _Tp, unsigned _Uint>
...
I have a class that can be decorated with a set of add-on templates to provide additional functionality. Each add-on has an identifying addon_value that the base class needs to know.
The code below is an example of what I would like to do. Obviously, the main() function fails to compile. The goal is for CBase::GetValueOfAddOns() to kno...
I have a class that can be decorated with a set of add-on templates to provide additional functionality. Each add-on needs to be able to call the base class and the user needs to be able to call the base class (either directly or using the CMyClass as a proxy).
Unfortunately, the compiler can't tell which base class I'm calling and I ge...
I am creating a custom control.
I want the template for this control to use different controls for the root control based on the value of a dependency property called CanExpand. CanExpand is defined in the custom control class.
If CanExpand is true, I want to display using an Expander:
<ControlTemplate ...>
<Expander ...>
<!-...
Okay, so I've created a custom template for Joomla, and gotten that working. However, I'm wanting to create a custom option for displaying modules within the template. I found that if I create the appropriate function in the /html/modules.php file in my template I can make a
<jdoc:include type="modules" name="menu" style="myCustom" />
...
Hello,
What do gdb users here think about its capabilities in regards to debugging code with templates and STL?
Do you use any tricks to make the debugging any simpler? Perhaps some Python scripts? Or are you satisfied the way it is at present in gdb (ver 6.x, haven't tried 7.x yet)?
Thanks.
...
Eclipse's default template for new types (Window > Preferences > Code Style > Code Templates > New Java Files) looks like this:
${filecomment}
${package_declaration}
${typecomment}
${type_declaration}
Creating a new class, it'll look something like this:
package pkg;
import blah.blah;
public class FileName {
// Class is acces...
I have created a UItableView using the default Xcode template and configure it to display five rows.
I select the first cell on the table. When I select another cell I notice the first one stay selected until I remove my finger from the second one.
sample:
http://img190.imageshack.us/img190/7184/cellsz.jpg
I want a cell to become selec...
Hi, I've been playing around recently with the D language and I have a quick question about templates.
I'm inserting characters and strings into an existing string in code and came up with this function:
string insert(T)(string s1, T s2, uint position) {
return s1[0 .. position] ~ s2 ~ s1[position .. $];
}
Now, I have several que...
I have a class called Atomic which is basically an _Atomic_word plus methods that call the gcc atomic builtins.
class Atomic{
mutable volatile _Atomic_word value_;
public:
Atomic(int value = 0): value_(value) {}
**** blah blah ****
};
I would like std::numeric_limits<Atomic> to instantiate to std::numeric_limits<underly...