113 Topics

Member Avatar for
Member Avatar for Labdabeta

If I have a templated storage class, how can I create a specialized template for nested storage class. I already know how to specialize pointer template, but I don't know how to specialize this. EG: [CODE]template <typename Type> class Array { ///Array class code }; int main() { Array<int> rob; …

Member Avatar for Narue
0
134
Member Avatar for Labdabeta

Is there any way to implement a scope change for the template keyword? I have a templated class with almost 100 different functions and my code looks disgusting with my external declarations. Is there any way to implement a scope increase for template? EG: [CODE]template <typename Type> class TypeClass { …

Member Avatar for Fbody
0
201
Member Avatar for mmartino

Hello, I am trying to write a templated linked list, and I am having some difficulties with the add() function. It seems like different behavior occurs depending on how I add to my list, but my two test cases don't seem that different to me. I'll post the list.h, and …

Member Avatar for Fbody
0
177
Member Avatar for Labdabeta

I need a few helps for some things that I just cannot get the syntax of! (I need these, and if you don't believe me I can post the reason) 1) Creating a function within a function 2) Creating a class within a function 3) Declaring a template function outside …

Member Avatar for mike_2000_17
0
125
Member Avatar for Labdabeta

I am working on making an error header file and this is what I have: [CODE]#include <stdio.h> #include <stdlib.h> #include <iostream> #include <sstream> #include <string> #define VANARGS(n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n33,n34,n35,n36,n37,n38,n39,n40,n41,n42,n43,n44,n45,n46,n47,n48,n49,n50,n51,n52,n53,n54,n55,n56,n57,n58,n59,n60,n61,n62,n63,N,...) N #define __VA_NARGS__(...) (VANARGS(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) #define ERROR(...) (\ (__VA_NARGS__(__VA_ARGS__)==0)?"NONE":(\ (__VA_NARGS__(__VA_ARGS__)==1)?(_1(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==2)?(_2(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==3)?(_3(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==4)?(_4(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==5)?(_5(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==6)?(_6(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==7)?(_7(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==8)?(_8(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==9)?(_9(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==10)?(_10(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==11)?(_11(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==12)?(_12(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==13)?(_13(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==14)?(_14(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==15)?(_15(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ …

Member Avatar for Labdabeta
0
252
Member Avatar for Labdabeta

I made a header file to convert strings to numbers of base X. That is I want: [CODE]int num=B<16,int>("FFF");[/CODE] To equal: [CODE]int num=0xFFF;[/CODE] Here is the code so far: [CODE]#include <string> int numb(char in) { if (in>='0'&&in<='9') return in-'0'; else if (in>='a'&&in<='z') return in-'a'; else if (in>='A'&&in<='Z') return in-'A'; } …

Member Avatar for Labdabeta
0
138
Member Avatar for AMADH

Hello, I was wondering if someone could help me. I am new to mysql/php and I was wondering if there is a way that I can have php create pages for me. What I want is that I no longer need to create new page, so I will have a …

Member Avatar for pixelsoul
0
815
Member Avatar for Charlton21

I need to turn this code for a class that checks for a out-of-bound value: class array {public : int & operator [] (int); // Prototype; overloaded operator int size () // In-line function {return ub - lb + 1; }; int lbound () {return lb; }; int ubound () …

Member Avatar for Narue
0
303
Member Avatar for arthurav

I have the following program : [CODE] #include<iostream> #include<string> #include<conio.h> using namespace std; template <class T> class matrice { T **a; int m,n; public: matrice(); matrice(int,int,int); matrice(char *); matrice(int,int,T **); matrice(matrice &x); ~matrice(){}; template <class U> friend ostream &operator <<(ostream &,matrice<U> &); int getNrLinii(){ return m; } int getNrColoane(){ return …

Member Avatar for Fbody
0
187
Member Avatar for arthurav

I am creating a template class for working with matrices and get an error when I try to use the overloaded << operator. This is the code: [CODE]#include<iostream> #include<string> #include<conio.h> using namespace std; template <class T> class matrice { T **a; int m,n; public: matrice(); matrice(int,int); matrice(FILE *); matrice(int,int,T **); …

Member Avatar for vijayan121
0
2K
Member Avatar for joshdecore

hi, I need to create a joomla ecommerce template for myself. Can you give me an easy method to biuld my site, I meam template.

Member Avatar for maryparker
0
71
Member Avatar for stljim

Hello everyone, I'm _very_ new to xml, especially converting using an xslt. Here's my source XML generated by Eeye Retina. This data is being used by MS Access and I don't need all the data from the original XML. When I try to run the MS Access app I get …

Member Avatar for iceandrews
0
254
Member Avatar for Mi-Dia

I am in the hard task of rewriting a template system, specificly to support repeating content of a forum script. I am currently tyring this with a dummy file at the moment and I am stuck on one part. What is basically does, is load the following html which has …

Member Avatar for Mi-Dia
0
118
Member Avatar for george61

I'm working on an entertainment site and there is some design mistake which I made. But everything looks good if zoomed out in 83% on chrome and 75% on mozilla and IE. What is the solution to resize everything or there is another way?

Member Avatar for Kraai
0
101
Member Avatar for white feather

[CODE] <Window.Resources> ... ... <DataTemplate DataType="{x:Type my:Section}"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=Name}"/> <TextBlock Text=" "/> <TextBlock Text="{Binding Path=Instructor}"/> <TextBlock Text=" "/> <TextBlock Text="{Binding Path=Cours}"/> </StackPanel> </DataTemplate> <DataTemplate DataType="{x:Type my:Instructor}" x:Key="InstructorDataTemp"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=FirstName}"/> <TextBlock Text=" "/> <TextBlock Text="{Binding Path=LastName}"/> </StackPanel> </DataTemplate> <DataTemplate DataType="{x:Type my:Cours}" x:Key="CourseDataTemp"> <StackPanel Orientation="Horizontal"> <TextBlock …

Member Avatar for white feather
0
171
Member Avatar for netclick

I would like to design web site templates and start selling templates online. I am a designer not a programmer. Is there a Framework for Wordpress that I could use to build various design layouts with options in various places? I would liek to sell them as my own rather …

Member Avatar for badsolo
0
190
Member Avatar for brandonrunyon

I have a class "Homework" that has a private attribute "int time" and I have set up a + operator to add the times of two Object instances. I have also created a Template "sum(T a, T b)" that takes two arguments and adds them together. I'm having difficulty using …

Member Avatar for brandonrunyon
0
255
Member Avatar for Setvir

Hi guys and gals! I want to know if I am on the right track. I am working on a simple in-house cms. Here is a templating function I wrote to test an idea. It does work. [LIST=1] [*] The function loads the template file, [*] finds all the template …

Member Avatar for Setvir
0
150
Member Avatar for dspjm

Suppose I have these two functions: [CODE]template<class T> bool largerthan(T a, T b) { if(a>b) return true; return false; } template<class T> int reduce(T ar[], int n) { list<T> buffer; buffer.insert(buffer.begin(), ar, ar+n); [COLOR="Red"]buffer.sort(largerthan);[/COLOR] buffer.unique(); copy(buffer.begin(),buffer.end(), ar); return buffer.size(); } [/CODE] I have two kinds of arrays for reduce(): string …

Member Avatar for vijayan121
0
104
Member Avatar for alwaysLearning0

This is just for fun and to see how people do it, it will help me to learn different techniques also. If no one answers i will understand. :) Lets say you have a template class. You want a certain method of this class will have some sort of checking …

Member Avatar for mike_2000_17
0
182
Member Avatar for RobBobSmith

Hello all, I would be grateful for some help with a function template problem. I cannot figure out how to pass a matrix as an argument in a template function. I keep getting the error "does not match any template declaration". Can anyone suggest what my problem is? Have I …

Member Avatar for Fbody
0
183
Member Avatar for danalovesc

Hi all, i'm new to Templates and when i tried to implement templates methods which needs to use a map (which is a member in private), the map can only do 3 things: insert, swap, and operator =. and i don't get the full functionality of map.. Here's the code: …

Member Avatar for danalovesc
0
90
Member Avatar for drweni

Hello.. I need help with following: I have flash template downloaded, just trying things.. so I can edit text in tfile_main.xml file ant that's ok. But I need to change the font, because this font doesn't support some eastern europan letters (č,ć,š...) .. I know when I have .swf file …

Member Avatar for rajarajan2017
0
71
Member Avatar for Mozza314

I'm a little new to C++ templating, and I'm having trouble understanding this behaviour. Basically, I have a templated class, and I want to define the = operator between the class and the same class with any template parameter. The problem is that the overloaded version of the = operator …

Member Avatar for mike_2000_17
0
250
Member Avatar for chaienbungbu

I've done an example of 'template specialization'. Here is the code: [code] // template specialization #include <iostream> using namespace std; // class template: template <class T> class mycontainer { private: T element; public: // only prototype mycontainer (T); T increase (); }; // class method definition template <class T> mycontainer<T> …

Member Avatar for major_tom3
0
230
Member Avatar for xofth

I need a website template that looks like bloger so i can post new topics. i dont need blogger template i want a website template..

Member Avatar for mariko
0
123
Member Avatar for gubbasrikanth

Hi, I have one more doubt in dreamweaver, how to export template based documents in a site to another site without include Template markup

0
67
Member Avatar for CleverSunshine

I need to find a Template Generator that I can use to create blogger templates for my readers or a template design software that will code in XHTML/HTML so that I can offer them on my website. If anyone knows of software that will help me reach my goal please …

Member Avatar for redesignunit
0
153
Member Avatar for kaydee123

I want to do a double linked list that has has in each element one operator(+-*/) and one value of type double. I am having trouble in defining the class of the list. Should I use C++ Class Template Specialization or what? [CODE] include<iostream> using namespace std; template <typename T> …

Member Avatar for jonsca
-1
125
Member Avatar for badjad

Hello, I am looking for help in putting together a social marketing policy/procedure for my organization. Everything I have found online has been created for companies that are allowing/not allowing their employees to use social networking. That is not what I need. I am looking for a more of how …

Member Avatar for larywaugh
0
193

The End.