Programming :: Define A Static Member In A Template Class?
Oct 6, 2009
i have trouble to define a static member in a template, and i search from google, but didn't find any similar case, my case is a little complex, i paste the code below.code in xxx.h
Code:
template <class T> class FreeListManager
{
[code]...
View 6 Replies
ADVERTISEMENT
Sep 14, 2010
I have a problem. This class is a base class for a basic enum handler:
Code:
#define ENUMOBJECT_BEGIN_ELEMENTS enum Element {
#define ENUMOBJECT_END_ELEMENTS ElementCount, DefaultElement, NoElement };
[code]...
View 8 Replies
View Related
Mar 30, 2011
I'm venturing into the world of OpenGL, but in the process of writing my graphics library I ran into a problem... My code is:
Code:
#include <stdio.h>
#include <stdlib.h>
[code]...
View 5 Replies
View Related
Mar 28, 2011
I had some trouble doing this but finally figured it out. Here is a general solution:
Code:
#include <iostream>
using namespace std;
[code]....
View 1 Replies
View Related
Jun 7, 2011
The code below defines an array of structures in a class. I would like this to be a Static array and then initialize the array in a initialization method. I understand that initialization lists are the way to go but due to the size and complexity of the array I plan on using (the example below is a simple snippet that illustrates the problem) I would like to use the initialization method. However, I cant even get this thing to compile. The error says the reference to the ArrayOfStructs in the initialization routine is undefined.
l_long_Island
P.S. This is the error message
undefined reference to `ClassWithStaticArray::ArrayOfStruts'
class ClassWithStaticArray {
public:
struct IntegerStruct
{
[code]....
View 5 Replies
View Related
Jan 6, 2010
I am using slackware 13 and openldap 2.4
with webmin.
whenever I start my server i get following error "root DN missing".
when I try to create root DN I get error "unable to create object class".
where do we define object classes?
View 5 Replies
View Related
Aug 27, 2010
I get this error when setting up my site. Software error: Can't locate Class/Template.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /var/www/html/en/subscribe.cgi line 10. BEGIN failed--compilation aborted at /var/www/html/en/subscribe.cgi line 10. send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.
I have tried the following with no success: # yum install perl-Class-Template from the Rpmforge repo [URL] Or use the cpan command 1) # yum install perl-CPAN
2) # cpan
3) > install Class::Template
..
The website I am trying to get working is hosted on CentOS. The version is 2.6.18-194.11.1.el5PAE. Im trying to get migrate the site from one server to another and now the cgi script doesnt execute correctly as it requires the class Template which is in a folder within the website tree.
View 1 Replies
View Related
Feb 12, 2010
I'm having some problems on the line with ***. This is from a OpenEntidade.java class file and I'm trying to update EmprestadorView's variables.
EmprestadorView.java
public class EmprestadorView extends FrameView {
...
OpenEntidade.java
-----------------
public class OpenEntidade extends javax.swing.JFrame {
[code]....
View 2 Replies
View Related
Nov 26, 2010
I am getting the following error:'auto_ptr' is not a member of 'std'This was working fine in gcc version 4.1.2 20080704 (Red Hat 4.1.2-48).After upgrading to gcc version 4.4.4 (GCC), it is NOT working.
View 2 Replies
View Related
Jan 17, 2011
is there any problem that might rise by by having a vector as a member of struct in c++ as follows.ex.
struct A
{
int a;
[code]...
View 2 Replies
View Related
Feb 6, 2011
I am having trouble understanding some concepts regarding C++ template specialization and I was hopping you guys can help me like you did last time.I will go right into the code and let the code do the talking.File foo.hpp
Code:
// Template Class
template < typename T1, typename T2> struct foo {
[code]....
View 2 Replies
View Related
Apr 27, 2010
I can define all variables in tcl programming in a file for instance var.cfgand source the same file in my tcl script such assource var.cfgIs this possible in perl too?
View 3 Replies
View Related
Jul 2, 2010
I following structure
typedef struct
{
[code]...
View 5 Replies
View Related
Dec 16, 2010
I have added new member "i_mymember" to inode on-disk structure in ext3_fs.h file and tried to access this in userspace program, but gives me error that "error: �struct ext3_inode� has no member named �i_mymember� "
I have compiled my kernel source code.
why this error is coming ...?
View 1 Replies
View Related
Aug 17, 2010
have an inherited base class that has some virtual members and I wish to overide these members in the derived class. So for example I have the following base class called B and the derived class called D. I will illustrate them both below. I am finding I get a linker error when making the project and cannot work out why this should be so.
Code:
class B {
public:
[code]...
View 14 Replies
View Related
Sep 8, 2010
I have two functions:
Quote:
void func1(std::string &s)
{
s.clear();
}
[code]....
Is there a way to create one template function for both vector and string that would clear them?
View 4 Replies
View Related
Jan 12, 2011
What functions are available on linux for a c++ program to determine if the current user is a member of a specific user group?
View 3 Replies
View Related
Oct 13, 2010
This may be a basic bash array/string operation related question, but I couldn't find any direct answer. So here it goes:I have a lot of data sorted in various directories. All directories need same processing except for a special group of directories. I have a symbolic link of the script in discussion in each directory. I want the script to get the name of the current directory, check if that belongs to special group and do specific operations.So I get the name of the directory
Code:
mm=`basename `pwd``
Now the the group of directories that needs something different to be done, contains these
[code]...
View 4 Replies
View Related
Aug 12, 2010
If I remove all the template stuff, it works.
whats going on here?
View 2 Replies
View Related
Jul 13, 2010
Right now we send notification emails using a velocity template (apache and java), the thing is that the notification engine call the Email.vm file to add all the information and variables. This process only attach the information (text) on the .vm file.
We need to send that email on html. The thing is that if we write the html code on the file, when the .vm file is called that email includes the code not the result of the html.
We have tried adding the headers and everything.
The question is:
Is there some way that we can pre-process the html code and include to that email the result?
Or can we tell the .vm file that it should be handle as html? (like php for example <?php ?>, the <html> and </html> tags doesn't work.
View 1 Replies
View Related
Jun 6, 2011
this should have been a simple task, but for some reason one of my rollovers plain old isn't workingmy html sheet
Code:
<div style="background:#F5F5E9 url('/sites/all/themes/flossmoore1/images/bricks250.png');padding:1px;padding-
[code]....
View 1 Replies
View Related
Jul 8, 2011
I am new to the whole concept of makefiles, and I'm trying to compile and build my program using a makefile template I have found. My project consists of three directories: "source", where my .cpp files are (source1.cpp, source2.cpp, source3.cpp), "include", where my .h files are (header1.h, header2.h, header3.h), and "obj", where the object files are to be stored (obj1.o, obj2.o, obj3.o). In the project root directory is my makefile, which is as follows:
Code:
EXEC = myexe
CC = g++
IDIR = include
SDIR = source
ODIR = obj
[Code]..
View 4 Replies
View Related
Feb 12, 2011
im trying to build a simple program for my C programming class, this is the source code
#include <stdio.h>
int main()
{
int length, width, length, height, area, perimeter;
perimeter = width + length + height;
area = width * length + heigth;
[Code]...
i dont see any error (you might)but every time i run it it runs but after it asks me to input for the width i do it but it doesn't take me to the length, it just stays blank until i input another value in the same place for the width, it asks me for 4 inputs in total i don;t know why, and after i run it different times it gives me different values for the perimeter and are. how can I fix this?
View 5 Replies
View Related
May 26, 2010
Is it possible to create a global struct variable with predefined member values?Only one instance of that struct is ever needed.
View 1 Replies
View Related
Mar 23, 2011
I'm trying to develop an html template parser employing Flex & Bison, but now I found a problem and I don't know if surrender, so let's see if you can guide me to the solution (if any).
[Code]...
(Here I simplified the code to make only print what it gets, but it returns a token and the text to the bison program). Now my problem is that I would like to get the unknown characters as an unique string. [using the flex file above, returns char by char all HTML code that is not a comment!].
So, Could it be possible to make a flex rule that gets the HTML code?. It is not necessary to check if HTML code is correct I do it (before parse) using expat. Also there is no need to check the resulted code it will be done by the parser or compiler of the used language.
I know that are a lot of tools that uses this kind of templates in all languages and systems... but I'm just exercising my pour flex&bison skills. Also, using my current flex file, I have to remove the string "<!--MARKUP" from the beginning and "-->" from the end of returned string to bison... But in reality, if I could manage the HTML code as a flex rule, I could solve that sednding to bison an start Token, the code and and end token.
View 1 Replies
View Related
Oct 30, 2009
I have a template similar to the following.
Code:
template <charT>
virtual void do_get_date(charT* = "str")
{ ... }
As you can see we have a problem. If we use a wchar_t instead the string wont be formatted right we need to prefix L in front. If we use char16_t we need to prefix a u in front. Is there a was to make the generic without resorting the the std::string class?
View 2 Replies
View Related
Mar 6, 2011
This works for "char" but i need "char*",how do I do it?
Code:
char* tk = (char*) calloc(ctk+1,sizeof(char*));
Error when I use it:
Code:
error: invalid conversion from har* to har
View 2 Replies
View Related
Oct 27, 2010
I wanted to implement a graph.By graph I mean to say that I am writing programs for BFS,DFS and other such stuff and want to see them in action. For this I started writing a program.The first entry point is to define a graph. I took a pen and paper and made a graph. Now to be able to code this in C.I defined a structure but I am finding problem in defining this structure. I looked into Google and came across incidence list and adjacency list representation [URL] after understanding that I am not able to understand how do I define my structure that would be a node in graph. Here is what my graph looks like
Quote:
|-----------31
| |
| 2---4---6---8
| |
[code]....
View 3 Replies
View Related
Mar 12, 2010
I have a problem with compiling vdrift-2009-06-15 using scons. As the source that i obtained only supports scons i cannot use make. the error that i get when i try to compile it in GNOME Terminal is: scons: Reading SConscript files ... scons: warning: The Options class is deprecated; use the Variables class instead.
File "/home/mohit/Download/vdrift-2009-06-15/SConstruct", line 9, in <module>
scons: warning: The BoolOption() function is deprecated; use the BoolVariable() function instead.
File "/home/mohit/Download/vdrift-2009-06-15/SConstruct", line 13, in <module>
Checking for C++ header file asio.hpp... (cached) yes
Checking for C++ header file boost/bind.hpp... (cached) yes
Checking for C++ header file GL/gl.h... (cached) yes
Checking for C++ header file GL/glu.h... (cached) yes
Checking for C++ header file SDL/SDL.h... (cached) yes
[Code]........
View 4 Replies
View Related
Mar 25, 2010
I want my bash file to read from "input.dat" the two values emin emax. My input file looks like that:
#cat input.dat
!Energies
emin 10.00 !minimum energy
emax 30.00 !maximum energy
Now this seems to be not so hard with the command awk
#!/bin/bash
awk '{FS=" "}/emin/{print $2}' input.dat
awk '{FS=" "}/emax/{print $2}' input.dat
[code]....
So far so good. Now, I want to define two variables (e.g. e1,e2) in the bash file, so that their values would correspond to 00.00 and 30.00, as read from the input file. This one I have not found yet, thus asking for your advice. At the end, writing echo $e1 $e2, I should get 10.00 30.00 This is even harder to me: I want to replace the values emin,emax in a new file "modify.dat" which looks like that:
...
c---- energy interval
emin = 1.00
emax = 2.00
...
with the values e1 and e2 I have in my bash file. In other words, I want to call "modify.dat", find these two lines and replace the numeric values with the e1 and e2. At the end, my file should be like:
...
c---- energy interval
emin = 10.00
emax = 30.00
...
View 3 Replies
View Related