Hi all,
I have a table design problem with the modeling of the dimensions of a work piece (mechanical part).
A work piece can be cylindrical (radius, height) or cuboid (width, length, height). Actually this is modeled like this :
table work_piece (
id INTEGER,
type INTEGER, -- type = 0...
Hi all,
I get a compilation error with this source code (simplified to isolate the problem) :
struct VirtualTable
{
template<typename _FUNC_>
void add()
{
}
}; // struct VirtualTable
template<typename _T_>
struct functor
{
private:
VirtualTable* _vtable;
public...
Does someone know the rules for the C POSIX library? I mean what headers, routines are always availables for C/C++ compilers?
For example <dirent.h> is a POSIX header but is not present in Visual C++ 2005. Another example is stricmp() for which Visual C++ 2005 complains about deprecation(it says...
Hello,
I would like to have a Singleton class that ensures to have only one instance wherever the code flow is in a DLL or in the main program.
My Singleton class is like this:
template<class G>
class Singleton
{
public:
// Unique instance of type G.
static G* instance ()
{...
Hello there,
I have defined a generic class for two-dimensional arrays, called Grid<G>.
I would like to define the operator[] with two arguments, ie the row and the column that define the coordinates of the item to access :
template<class G>
class Grid : public Array<G>
{
// All other...
Hi,
I have a problem with the compilation of some code. It appears when mixing generics with pointers and const.
Here is a dummy sample :
class Object//Our dummy data class
{};
template<class G>//A generic class defining a request
class A
{
public:
bool has (const G& v) const
{...
I want to know if a type is a pointer during execution.
I know the mechanism to use is partial specialization, I have found this source code :
#include <assert.h>
#include <iostream>
using namespace std;
template<class G>
struct is_pointer_type
{
static const bool value = false;
}...
Hi,
I have not tested it yet. Have someone already done this?
i.e. compile a C++ program with VC++ 7 command lines tool(or from the IDE) and try to debug it in VC++ 6.
--
Globos
Hi,
Currently I am detecting memory leaks with a very basic mechanism which consists of the VC++ debugger and the C runtime debug heap functions.
I have to put these lines :
#define CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
at the begining of the file containing the main...
Hi,
I'm stuck with using an ActiveX control outside MS Visual Studio (I use command line tools).
The ActiveX Container I use is QAxContainer (a Qt module).
Wrapping the control with Qt is ok.
But I need to query the IDispatch interface of the control, because they are calls to the ActiveX...
Hi,
I would like to list the files of a directory recursively.
I want the output format to be like this example (listing current directory) :
foo.hh
foo.cpp
sub-dir1/stuff.hh
sub-dir1/other-stuff.hh
sub-dir1/sub-dir11/ooo.hh
sub-dir2/bar.hh
sub-dir2/other-bar.hh
One file per line, and...
Hi,
I don't follow the recommended C++ practice that consists to separate header files and implementation files.
Most of my classes are fully defined in their header files.
The well-known drawback is that it makes compilation slow.
By now I feel the need to really reduce compilation times, I...
Hi,
I want to emulate the 'implies' (=>) logical operator in C++. There's no built-in support for it.
For this purpose, I firstly defined a macro :
# define implies(a, b) !(a) || (b)
And it works fine, especially if a is false then b is not evaluated. But syntactically speaking, this is...
Hi,
I've taken a look at the STL documentation and found no means to get the defined keys of hash_map objects. How to get these keys?
Thanks.
--
Globos
Hi all,
I'm working on a software project with a person belonging to another firm than mine. Currently, we exchange our work(documents, test cases, etc.) via emails. For the moment it's ok, but I'm looking for a tool that can centralize the work done, and can feature project management. I...
Hi,
I have a strange problem. When I compile my code with option -O1 or -O2(respectively creates the smallest code, creates the fastest code) and then I try to run it, it crashes. If the code was compiled with this optimization disabled, execution is ok.
Does someone ever meet the same problem...
Hi,
Can someone advise me for a free HTML source editor(more powerful than notepad, please)?
expected basic features:
-syntax highlighting
-javascript code edition
-some automation tools(array generation, etc.)
Thanks.
--
Globos
Hi,
I've installed STL headers from sgi in a path like :
$(LIBDIR)\STL\include
I want the Microsoft compiler to use these headers instead of those located in ...\VC98\include.
I'm using Visual C++ 6.0, how to do this?
Thanks.
--
Globos
Consider the following basic code:
class A
{
public:
virtual void proc () = 0;//deferred procedure
};
class B : public A
{ };
class C : public A
{
public:
virtual void proc ()//basic implementation
{ }
};
class D : public B, public C
{ };
int main ()
{
D d;
return 0;
}
As you...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.