|
How to impliment searching the definition of a c/c++ function in a c/c++ source file For visual studio, someone wrote a great find tool http://workspacewhiz.com/. It uses ctags, which can do the job for you? -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] ... 21 Jun 2008 07:39
question about template specialization Hi everyone, I'm having trouble understand result of the following simple case. Can someone help explaining what's going on there? Thanks! ///////////////////////////////////////////////////////////////////////////////////////// template < typename T > struct A { template < typename U > struct B{}; }; ... 22 Jun 2008 17:19
a confusing behavior for int=double I was just playing around assigning a double value to an int: #include<iostream> #include<iomanip> int main(){ double z = 1.5774; std::cout << std::setprecision(10); std::cout << "z=" << z << ", 10000z=" << 10000*z << std::endl; int k = z*10000; std::cout<< "k= " << k << std::endl; ... 22 Jun 2008 19:22
templates T and return value I have successfully used templates in the code below. I find I can't change it to return a value to main(). I get these error messages: c:\Documents and Settings\JBaker\My Documents\Visual Studio Projects\Effective C++ 3rd Editon\Macro Item 2\macro_main.cpp(7): error C2951: template declarations are only permitted ... 25 Jun 2008 20:09
implicit conversion Dear all, we just discovered a production code error: class K { public: explicit K(bool){} //explicit K(boost::tribool){} explicit K(const std::string&){} }; int main() { //takes boolean constructor instead of std::string K k("e"); return 0; } is t... 8 Jul 2008 06:56
STL containers w/ smart pointers Greetings, I am wondering what would be the best way to instanciate an STL container with a special allocator but using a smart pointer to access the nodes. Apart from this the allocator will generate dictinct pointee type named "smart<>". For example: template <typename T> smart { T e_; ...}; ... 22 Jun 2008 04:03
Unicode Marker: (was cast int to char) From my previous thread of "cast int to char" I'm sure my method can be improved! What would be the best way to do the following: // New file: write Unicode marker unsigned char buf[10]; buf[0] = static_cast<int>(254); buf[1] = static_cast<int>(255); m_file.Write(&buf[0],2); { 254 and 255 are of type int, ... 21 Jun 2008 07:39
Issue #624 (was Re: Allocating huge objects dynamically?) Greg Herlihy ha scritto: The answer is "no". The behavior of a C++ program that attempts to allocate an array of an N number of T objects (when N * T is too large to represent as a size_t value) is currently not defined by the C++ Standard. There is however an open language isssue (#624) that would r... 20 Jun 2008 15:20
Thread mess Hi all, I've recently stepped in a project of medium size, and at the easy question: "are those class instances shared between two or more threads" the response was: "no... wait... yes, well I'm not sure... I don't know...". Riiiight. I used the following technique that should permit to detect (at runtime, sigh!)... 25 Jun 2008 20:09
Application crashes while using OTL class I am using the OTL library for database interaction(otl.sourceforge.net) This is the sample code from my application: strm_ << parm.corp_id(); strm_ << parm.prod_id(); write_to_log(("Before parm.eff_ts()"<<parm.eff_ts()) strm_ << parm.eff_ts(); /** Application crashes here **/ write_to_log(("After parm.eff_t... 20 Jun 2008 15:20 |