Compiler Error C2783 when using Bitsets. 
Author Message
 Compiler Error C2783 when using Bitsets.

Platform: Windows 2000 Server, Visual Studio 7.0 (.NET) edition.

Hello,

I tried compiling the following code in VC++7.0

#define MAX_VAL     16
typedef std::bitset<MAX_VAL> MyBitSet;

class CMyClass
{
    MyBitSet     m_Values;//bitset

Quote:
};

void CMyClass::Test()
{
     string s = m_Values.to_string();//to check the value in the bitset

Quote:
}

When compiling the above line the compiler gives my Compiler error C2783,
could not deduce template argument for '<_bitset 16>'

I made a search on this error in MSDN, it says that this issue exists in
earlier versions of VC++ and was corrected in VC++6.0.

Can any one let me know why am I facing this error in VC++7.0?
How can I get rid of this error, in the above case?

Thanks and Regards
Ganga



Tue, 06 Sep 2005 18:06:40 GMT  
 Compiler Error C2783 when using Bitsets.

Quote:
> I tried compiling the following code in VC++7.0

> #define MAX_VAL     16
> typedef std::bitset<MAX_VAL> MyBitSet;

> class CMyClass
> {
>     MyBitSet     m_Values;//bitset
> };

> void CMyClass::Test()
> {
>      string s = m_Values.to_string();//to check the value in the bitset
> }

> When compiling the above line the compiler gives my Compiler error C2783,
> could not deduce template argument for '<_bitset 16>'

> I made a search on this error in MSDN, it says that this issue exists in
> earlier versions of VC++ and was corrected in VC++6.0.

> Can any one let me know why am I facing this error in VC++7.0?
> How can I get rid of this error, in the above case?

You have to call to_string as to_string<char, std::char_traits<char>,
std::allocator<char>(). This is not a bug in this implementation, but a
feature of the language that found its way into bitset, which was
standardized before it was ever implemented.

V6.0 has trouble with function calls of the form f<type>(args), but V7.0
does not.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com



Tue, 06 Sep 2005 19:14:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Why am i getting Compiler Error C2783 in VC++7.0 when using Bitsets?

2. Compiler error in Using DatagridControl using VC++ 6.0

3. bitset error

4. VC++6.0/SP3 Compiler Error: INTERNAL COMPILER ERROR

5. compiler error using volatile modifier!

6. compiler error using volatile keyword!

7. Internal compiler error using delegate

8. VC7 internal compiler error using comparison function object with std::sort

9. C1001 - Internal Compiler Error When Using Templates In VC++ 6.0 SP4

10. ERROR USING MS C OPTIMIZING COMPILER VER 5.0

11. Help on compiler error using GUSDK

12. Getting compiler error C4284 when using STL List.

 

 
Powered by phpBB® Forum Software