comp.lang.c++
  Home FAQ Contact Sign in
comp.lang.c++ only
 
Advanced search
December 2007
motuwethfrsasuw
     12 48
3456789 49
10111213141516 50
17181920212223 51
24252627282930 52
31       1
2007
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.c++ Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Can a static member function access non-static member?         


Author: dolphin
Date: Dec 4, 2007 23:27

Hello everyone! Can a static member function access non-static member?
I think it is illegal.Is it right?
2 Comments
  Re: how to achieve thread safety at element level in STL data structures like hash map, vectors         


Author: yurec
Date: Dec 4, 2007 23:13

On Dec 4, 4:22 am, grbgooglefan gmail.com> wrote:
> Our application uses the caching heavily to store the data from
> databases & also the runtime orders information.
> All these caches are built on STL hash map, vectors & maps and data
> format is the structures.
> There are multiple threads accessing these caches simultaneously for
> reading the data as well as updating the data.
> Whenever any thread accesses the cache, it locks that cache & finds
> the required element. Does the actions required & unlocks the cache.
> I am finding that this is causing the other threads to wait for longer
> time because the locking is at cache level.
> I would like to make this locking quite finer & granular, in such a
> way that only the single structure which is to be updated is locked.
>...
Show full article (1.47Kb)
1 Comment
  What is the Cost of Visual C++?         


Author: Sanny
Date: Dec 4, 2007 22:42

I am interested in buying Visual C++. I went to microsoft and they
offer it for download. Is it free to download?

What is the cost to purchase Visual C++ Package.

And what can be done with Visual C++? Do I need to purchase whole
Visual Studio or only the Visual C++?

Will msdn come along free or I have to purchase it seperately.

Anyone knowing it or can show me a link where I can purchase Visual C+
+ will be of great help.

Bye
Sanny
no comments
  Re: user-defined conversion combined with argument-dependent lookup         


Author: Abhishek Padmanabh
Date: Dec 4, 2007 21:41

On Dec 1, 3:20 am, Belebele gmail.com> wrote:
> Suppose that I have a class that has a user-defined conversion to
> std::string, and I would like to compare objects of that class to
> "strings" (e.g. literals, std::strings):
>
> class InUpperCase {
> public:
> operator std::string() const;
>
> };
>

Instead of providing a conversion operator, why don't you provide
friend overload for operator== taking InUpperCase and std::string as
arguments?
no comments
  Re: strange test question         


Author: Martin Ambuhl
Date: Dec 4, 2007 21:03

Heinrich Pumpernickel wrote:
> i got the following strange extra question in a written test
> today . since the test was abt c/c++ i guess this is on topic here

The mythical language "c/c++" is not topical in either comp.lang.c or
comp.lang.c++.
> 22) Consider the following quote:
>
> "If Mickey's a mouse, Donald's a duck, Pluto's a dog... What's Goofy?"
>
> a) Who said that?
> b) What is the correct answer to that question?
Show full article (0.96Kb)
3 Comments
  c++ calling c functions         


Author: teju
Date: Dec 4, 2007 20:18

hi,

i am trying 2 merge 2 projects into one project.One project is using c
language and the other one is using c++ code.

both are working very fine independently.But now i need to merge both
and my c++ code should call c code.but when i tried to call a function
in c code externing that function in my c++ code, i am getting
unresolved external symbol error. Whatever i try its giving more and
more errrors...so is it possible to merge 2 projects?

if so how can i do that?

please reply....

- Thejaswini
4 Comments
  Re: strange test question         


Author: Joel Haugen
Date: Dec 4, 2007 19:26

Heinrich Pumpernickel wrote:
> i got the following strange extra question in a written test
> today . since the test was abt c/c++ i guess this is on topic here
>
> --8<--
>
> 22) Consider the following quote:
>
> "If Mickey's a mouse, Donald's a duck, Pluto's a dog... What's Goofy?"
>
> a) Who said that?
> b) What is the correct answer to that question?
>
> --8<--
>
> doz ne1 know?
>
> thnk u
>
> -- ...
Show full article (0.58Kb)
5 Comments
  Re: how to achieve thread safety at element level in STL data structures like hash map, vectors         


Author: Joe Seigh
Date: Dec 4, 2007 19:02

grbgooglefan wrote:
[...]
> Great inputs & have helped me start thinking in bigger terms.
> Yes, I am using the hash map, etc from default available STL library
> on Linux (libstdc++). I am using them as memory cache for server
> application.
> Most of these caches are built using the string as key and the
> structure as data.
> Flow of functions happens somewhat as below in the application:
> Thread 1 gets data from database using select query. Populates that
> data in the structures & pushes that structure on the cache.
> Thread 2 then picks up that structure & uses it for getting other live
> real time data from other service. Once that real time data is
> available, this Thread 2 keeps on updating that data in the structures
> in the cache.
> There Thread 3 which reads the data from this cache & uses for
> processing the requests from the client application.
>
> So all types of data structure operations - insertions, erasing,
> updating, reading are happening on this cache with the strctures. ...
Show full article (1.62Kb)
no comments
  Re: Swapping a single pointer item in vector?         


Author: Jim Langston
Date: Dec 4, 2007 19:01

"Howard" here.com> wrote in message
news:FLWdnZnnHe38ZMjanZ2dnUVZ_vCknZ2d@comcast.com...
> Hi all,
> is there an easy way to swap one pointer item in a vector with a
> pointer that's not yet in the vector?
>
> Currently, I'm using begin()+index to get an iterator to the item I
> want to swap out, then deleting the pointer there, then using erase to get
> rid of the vector item itself and get an iterator to the next item, and
> finally using insert to put my new pointer in the correct place. Is there
> an easier way?

Just change it. The output of the following program is
10 20
10 10

#include
#include
Show full article (1.16Kb)
no comments
  Re: Displaying Non-ASCII Characters in C++         


Author: Rahul
Date: Dec 4, 2007 18:54

On Dec 5, 6:23 am, tushar.sax...@gmail.com wrote:
> This post is a follow up to the post at :http://groups.google.com/group/comp.lang.c++/browse_thread/thread/83a...
> as my original question was answered there, but I have some additional
> problems now.
>
> Basically what I want to do is : Given an input UTF-8 encoded file
> containing HTML sequences such as "&", I want to be able to
> replace these sequences with their UTF-8 representations (i.e. "&")
>
> What I have so far: Looking at some of the source code of the Mozilla
> Firefox project, I have a small class that can convert the HTML
> sequences into a number representing the Unicode value of that
> character. i.e. "&" is represented by a Unicode value of 38
> (source :http://www.ascii.cl/htmlcodes.htm)
>
> My question: How can I use this unicode value to convert it into the
> character "&" and write it to a file/display on the terminal? I tried
> using something along the lines of printf("\u0012"), but that returns
> the following compilation error : "\u0012 is not a valid universal
> character" ...
Show full article (1.32Kb)
no comments
1 2 3 4