First thanks zmbd for formatting the code, my bad and thank you very much Banfa for the insight reply.
I'm trying to remember why I used the static key word in the first place, anyway I removed the static key words as recommended as well then placed the inline keyword for template specialization function to prevent complier errors.
I think I may need to and read over Bjarne Stroustrup The C++ Programming Language
User Profile
Collapse
-
Explicit Specialization cannot have a storage class
Hi there,
I am porting code from windows using visual studio to mac with xcode.
Quite a lot of issue have a appeared, which is no surprise, one warning that keeps on appearing is Explicit Specialiszation cannot have a storage class:
Code:enum SortReturnCodeEnum {LOWEST=1, HIGHEST=2, HIGHLOW = 3, IDENTICAL=4}; template<typename tKey> static SortReturnCodeEnum DefaultCompare(typename ArgType<tKey>::ARGT
Last edited by zmbd; Jan 31 '13, 09:06 PM. Reason: [Z{Please use the [CODE/] button to format posted script}] -
Started a new clean slate of code and now it works ... i have no idea what sill mistake i did previously lol. Oh well thanks for your help Banfa :)Leave a comment:
-
hmmm interesting .. why am i still getting errors. Im going to do a few more tests tonight and find out why im getting errors. Thanks for the replyLeave a comment:
-
thanks for the reply banfa but sadly to say, i have already done this and i still receive the "Error 8 error C2955: 'Lex::Maths::He lper' : use of class template requires template argument list"
but it did remove the "Error 10 error C2670: 'Lex::Maths::He lper<T>::setNaN ' : the function template cannot convert parameter 1 from type" errorsLeave a comment:
-
class template with static member functions problem
Hi there,
I'm having a little bit of a problem and hopefully some one can help me.
I have not programmed in c++ for a while so excuse me for being silly
My problem involves with me creating a template class with static inlined member functions.
E.g.
LEX_INLINE is just a typedef for __forceinline
DllExport is a typedef for __declspec( dllexport )
Code:template<class
-
lol ok, new prob, will actually it not a problem yet.
I would just some comments back to see what i'm doing is correct.
Code://////////// this would be done on both sides of the server and the client #define BUFFERSIZE 80 struct PacketData { float x,y,z; }S_PacketData; struct Data { char *pcPacket; char *cpName; }S_Data;
Leave a comment:
-
oops found the problem, such amateur mistake, im only coping over one byte of data. someone slap meLeave a comment:
-
themadme replied to i want to know how we can write programe add,sub,divid,multible the matrix in c++in Cits quite simple, all you would need is a class that holds float values for a matrix ( _x1, _x2, and so on)
then you would need to put overloaded operator functions in that class for adding, subtracting etc.
for more info, just look up at directx SDK and LEARN how that has been done or as r035198x's said look up text books.Leave a comment:
-
Thanks for the replies and sorry about the bad naming in the last example
would that be the same problem if put a structure into a buffer.
Code://// class called Data Data::Data() { char *pcPacket = new char; } void Data::setPacketData( const char* pcPacketData ) { *pcPacket = *pcPacketData; } void Data::getPacketData( const char*
Leave a comment:
-
to pass in a unknown data and retrieving it
i want to set a class back to its original structure after calling a receive function. code below to explain
Code:class Node { public: Node(){} ~Node(){} }; class lol : public Node { public: string strName; }; class face { public: void vSetLOL( CONST Node &C_lol ) { this->C_lol
-
thank kindly for your reply.
Though i think i migth just use broadcasting, since im just working on the local network rather than the interent.
So is there any guides on how to do broadcasting as well as does anyone know if there are different ways for a client to search of a server?Leave a comment:
-
Searching for servers
Hi.
IN my application i want to have clients to search for a server with a certain name.
I am using WinSock, c++.
i have read about using WSASERVICECLASS INFO and WSANSCLASSINFO to create a service class
has anyone done any of that or did something differently?
Please Help
thanks -
-
TCP version:
Code:Server *pServer = (Server*)pParam; SOCKET socketClient; do { socketClient = accept( *pServer->p_socketServer, 0, 0 ); if ( socketClient == SOCKET_ERROR || pServer->usNumberOfClients >= pServer->usMAX_CLIENTS ) { // send an error code to client ////////////////////////////////////// closesocket( socketClient ); }
Leave a comment:
-
UDP Select() TCP
hi. ok my problem is that i have been using TCP for a while and now i want to change to UDP. Im using the select I/0 method.
i have a listening thread like this :
Expand|Select|W rap|Line Numbers
1. void Server::vListen ingThread( LPVOID pParam )
2. {
3. Server *pServer = (Server*)pParam ;
4. SOCKET socketClient;
5. do
6. {
7. ... -
actually ill just create a new one on c++ forums. this can be deletedLeave a comment:
-
well yeah, im using WinSock, thought it would more suitable for the network forums. Ok please move it to the c++ forumsLeave a comment:
-
Select() UDP and TCP
hi. ok my problem is that i have been using TCP for a while and now i want to change to UDP. Im using the select I/0 method.
i have a listening thread like this :
Code:void Server::vListeningThread( LPVOID pParam ) { Server *pServer = (Server*)pParam; SOCKET socketClient; do { socketClient = accept( *pServer->p_socketServer, 0, 0 ); if ( socketClient == SOCKET_ERROR
-
thank you very much, you have been very helpful, thanks againLeave a comment:
No activity results to display
Show More
Leave a comment: