is possible create a any type variable(1 variable that accept any type of values)?

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

MingW also uses gcc to compile projects. Dev-C++ (once again) is an IDE that just happens to have an old version of gcc already plugged into it. If you take a look at the link I gave you above, and do a little searching on the Internet, you should be able to upgrade MingW to use the latest version of gcc.

The boost libraries are extensively tested with gcc and Visual Studio, and I would say the two platforms that must compile successfully before being accepted by boost.org.

As to IDE's, there is CodeBlocks, which is up-to-date. Do an Intenet search and you will find other IDE's.

Regards,

Paul McKenzie

seems that i didn't understand that before..thanks
1 thing: the CodeBlocks suports C++11?

Re: is possible create a any type variable(1 variable that accept any type of values)

Originally Posted by Cambalinho

seems that i didn't understand that before..thanks
1 thing: the CodeBlocks suports C++11?

You're still confused.

CodeBlocks is an Integrated Development Environment. It is not a compiler. CodeBlocks, Dev-C++, and even Visual Studio do not know how to compile C++ source code. What does know how to compile C++ source code is the underlying compiler that is used in these programs.

For CodeBlocks, you can basically plug any compiler into it, but most of the time, people configure CodeBlocks to use MingW or gcc. The latest version of gcc is 4.8 (I believe), and it supports all that have been mentioned to you so far.

For Dev-C++, it was designed for gcc 3.x, which is close to 10 years old and out-of-date. Version 3.x of gcc is ok if you're purely interested in only C++ 98 standard, but anything beyond that, 3.x is not going to help you.

For Visual Studio, the compiler used is cl.exe (and cl.exe is being updated to keep up to the current standard (C++ 11). I've heard of Intel compiler being able to be plugged into the Visual Studio IDE, but have never tried it.

Basically what I'm saying to you is that every IDE that I know of uses 2 or 3 executables:

1) The compiler that compiles the source code to object code (gcc.exe, cl.exe, etc.)
2) The linker program that links the various object code (ld.exe, link.exe, etc.)
3) A debugger program or module that allows you to debug the program (gdb.exe, ddd.exe, Visual Studio's integrated debugger, etc.).

Optionally, an IDE may just build a "make" file and call a program that knows how to read the make file and build the program.

Except for 3), where the IDE needs to understand the debugger symbols and position the debugger indicator on the correct line, items 1) and 2) requires just calling the executable that compiles and then links.

As a matter of fact, you don't even need an IDE to develop a program. The reason why IDE's are used is that using the command-line for very large projects becomes very difficult to maintain (unless you have batch files to compile and link large projects, and some people/companies do just that, and that is to create batch files/make files and forget about IDE's to build their programs).

Re: is possible create a any type variable(1 variable that accept any type of values)

Originally Posted by Paul McKenzie

You're still confused.

CodeBlocks is an Integrated Development Environment. It is not a compiler. CodeBlocks, Dev-C++, and even Visual Studio do not know how to compile C++ source code. What does know how to compile C++ source code is the underlying compiler that is used in these programs.

For CodeBlocks, you can basically plug any compiler into it, but most of the time, people configure CodeBlocks to use MingW or gcc. The latest version of gcc is 4.8 (I believe), and it supports all that have been mentioned to you so far.

For Dev-C++, it was designed for gcc 3.x, which is close to 10 years old and out-of-date. Version 3.x of gcc is ok if you're purely interested in only C++ 98 standard, but anything beyond that, 3.x is not going to help you.

For Visual Studio, the compiler used is cl.exe (and cl.exe is being updated to keep up to the current standard (C++ 11). I've heard of Intel compiler being able to be plugged into the Visual Studio IDE, but have never tried it.

Basically what I'm saying to you is that every IDE that I know of uses 2 or 3 executables:

1) The compiler that compiles the source code to object code (gcc.exe, cl.exe, etc.)
2) The linker program that links the various object code (ld.exe, link.exe, etc.)
3) A debugger program or module that allows you to debug the program (gdb.exe, ddd.exe, Visual Studio's integrated debugger, etc.).

Optionally, an IDE may just build a "make" file and call a program that knows how to read the make file and build the program.

Except for 3), where the IDE needs to understand the debugger symbols and position the debugger indicator on the correct line, items 1) and 2) requires just calling the executable that compiles and then links.

As a matter of fact, you don't even need an IDE to develop a program. The reason why IDE's are used is that using the command-line for very large projects becomes very difficult to maintain (unless you have batch files to compile and link large projects, and some people/companies do just that, and that is to create batch files/make files and forget about IDE's to build their programs).

All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

Re: is possible create a any type variable(1 variable that accept any type of values)

Originally Posted by Cambalinho

i download the CodeBlocks but didn't came with compiler

Originally Posted by 2kaud

CodeBlocks is not a compiler and doesn't come with a compiler.

Actually, some of the official packages of CodeBlocks do come with a compiler, in particular some version of the MinGW port of GCC for two of the Windows installation packages: CodeBlocks binary packages.

Re: is possible create a any type variable(1 variable that accept any type of values)

Originally Posted by laserlight

Actually, some of the official packages of CodeBlocks do come with a compiler, in particular some version of the MinGW port of GCC for two of the Windows installation packages: CodeBlocks binary packages.

now the IDE is working normaly
1 - dowload the IDE;
2 - download MinGW compiler;
(more easy for have the last version)
3 - now we must 'tell' the IDE where is the compiler and choose the folders where is it. and tell it the files names inclued the compiler too

Re: is possible create a any type variable(1 variable that accept any type of values)

All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

Re: is possible create a any type variable(1 variable that accept any type of values)

Quite right! In c++, stream insertion (<<) is done via operator overloading of the << operator. By default, << operator overloads are provided for the in-built types (int, char *etc ) and for the string class. If you want to output data from your own type or class (eg variant) then you will need to supply your own version of the << operator that works for that type/class. If you want cout to work with the class variant, then you will need something like this

All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

Re: is possible create a any type variable(1 variable that accept any type of values)

and see my post #15 with the solution using variadic templates. As gcc 4.8.1 supports variadic templates, this code should compile and give you the write function you originally wanted without using the variant class - which I suspect is going to give more trouble than it's worth.

All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/