Kostikov Stas

  • Content count

  • Joined

  • Last visited

Community Reputation

101 Neutral

About Kostikov Stas

  • Rank
  1. Strange behavior of operator type

      Yes i wanted opinion on why code doesn't compiled. Not on why you think type free container is bad thing.     My mistake i raise this theme here.    I already say that i use template specialization, so it isn't code that you can use for any type without proper adjustment. Just you don't need to rewrite original code for make this work.  If you want discuss it. You welcome to do it in private. I don't see how it's related to my question.
  2. Strange behavior of operator type

    Template specialization doesn't help? template<typename type> void convert( const std::string & s, type & t); template<> void convert( const std::string & s, int & a) { a = atoi( s.c_str()); } template<> void convert( const string & s, float.& a) { a = atof( s.c_str()); } template< typename type> type convert( const string & s ) { type t; conver( s, t); return t; } Template can be just declaration but you can specialize different realization for different cases. So what problems with different list of arguments?
  3. Strange behavior of operator type

    I think you are right this is look like it. I though that move constructor can have somethings to do with the problem.
  4. Strange behavior of operator type

    Please lets skip holy wars. It's the reason i don't want to discuss my code here. It's in c++ style and i have my reasons to use it. And i actually more interested why code doesn't compiled. Let say this is theoretical interest lets forget about my previous messages. And before you start to explain what i should and what i shouldn't do in code, i know this, i have more than 13 years professional c++ experience, and more than 7 on lead position. Yes i do know which problems this code can create. And yes i know how to fix them.
  5. Strange behavior of operator type

    There is no type conflict. And syntax correct this code was compiled on different compilers. Gcc for mac and ubuntu compiled this code without questions. As well as 2010 and 2013 visual studio. On this moment only visual studio 2012 doesn't compiled this code. I know how to make it compile but then all other compilers might be failed. Yes i think you correct and this probably bug. When i asked this question i think there something with code wrong but look like code correct.
  6. Strange behavior of operator type

    Mine code isn't variant type. It's much different and I don't see a point to discuss it here. My question was why code writen according standart  isn't compiled.  Not why i shouldn't use this code. And i suggest to stay with topic question.
  7. Strange behavior of operator type

    On other site this sample was compiled with VC 2013 and it's was compiled. So only VC 2012 don't compile this code...
  8. Strange behavior of operator type

    Edit: removed message since don't related to topic
  9. Strange behavior of operator type

    Well i'm not sure where i have to put here static_cast  class SomeClass { public: operator std::string() { return ""; } template< typename type > operator type() { return type(); } }; This code doesn't compile. But this: class SomeClass { public: operator std::string() { return ""; } }; Compile and work fine.     Original code is correct by syntax. As i say it's compiled on gcc (new versions was tested). Compiled on VC 2010. And failed only on VC 2012. I can make side function for string case . But my question is can i fix operator type so he can work correctly?
  10. I wanted to make that my class can be converted to custom type:  #include <iostream> #include <string> class SomeClass { public: template< typename type > operator type() { return type(); } }; int main() { std::cout << "Hello, world!\n"; SomeClass sc; std::string str = sc; return 0; } This code is correct, compiled on gcc, vc 2010 but when i tried to build it on 2012 i get this error:   1>e:\test\operatortest\operatortest.cpp(22): error C2440: 'initializing' : cannot convert from 'SomeClass' to 'std::basic_string<_Elem,_Traits,_Alloc>' 1>          with 1>          [ 1>              _Elem=char, 1>              _Traits=std::char_traits<char>, 1>              _Alloc=std::allocator<char> 1>          ] 1>          No constructor could take the source type, or constructor overload resolution was ambiguous   I missed something? Is there is some change in standart ? Or it just bug in compiler?
  11. Hello,   I have game where is audio subsystem written with OpenSL ES. It's works fine until  i try to show dialog window, As soon as i show dialog sound is stop playing.   After show dialog activity recieve onWindowFocusChanged( false ).   I tried to set audiofocus, run dialog window in same activity. For now I'm out of ideas. Can someone give me some ideas where I can take a look and what to try?
  12. Is it possible to set up Screen Saver from game? I know how do this in Windows but now need do the same in Mac Os.
  13. Just curious there exists some site or mail address where i could learn about license terms? I found only postal address but before start i want to be sure i have all that neccessary.
  14. Lua on Bada.

    Almost we found solution but currently we test it. In short we create emulation in separate thread. In case of exception we kill the thread.
  15. Lua on Bada.

    I have one problem, we porting our engine on Bada and there everything fine except Lua. Lua required exceptions or setjmp/longjmp functions. These functions didn't exists on bada. There exists some solution?