<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Persistent notes &#187; cpp</title>
	<atom:link href="http://alexkr.com/tag/cpp/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexkr.com</link>
	<description>Alexander Krivutsenko&#039;s online journal</description>
	<lastBuildDate>Fri, 01 Oct 2010 08:16:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Is it safe to use std::vector with functions which take C array</title>
		<link>http://alexkr.com/posts/151/is-it-safe-to-use-stdvector-with-functions-which-take-c-array/</link>
		<comments>http://alexkr.com/posts/151/is-it-safe-to-use-stdvector-with-functions-which-take-c-array/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 15:02:28 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[short]]></category>
		<category><![CDATA[cpp]]></category>

		<guid isPermaLink="false">http://alexkr.com/posts/151/is-it-safe-to-use-stdvector-with-functions-which-take-c-array/</guid>
		<description><![CDATA[Answer. Yes, it is safe.
Standard says (I am using draft version but you can find it in 03):
&#8220;The elements of a vector are stored contiguously,
meaning that if v is a vector&#60;T, Allocator&#62; where T is some type other
than bool, then it obeys the identity &#038;v[n] == &#038;v[0] + n for all 0 &#60;=
n &#60; v.size().&#8221;

So, [...]]]></description>
		<wfw:commentRss>http://alexkr.com/posts/151/is-it-safe-to-use-stdvector-with-functions-which-take-c-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cmake, nmake, qmake and etc.</title>
		<link>http://alexkr.com/posts/147/cmake-nmake-qmake-and-etc/</link>
		<comments>http://alexkr.com/posts/147/cmake-nmake-qmake-and-etc/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 15:29:32 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[short]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[cpp]]></category>

		<guid isPermaLink="false">http://alexkr.com/posts/147/cmake-nmake-qmake-and-etc/</guid>
		<description><![CDATA[As I recently faced an issue when trying to build a &#8220;portable&#8221; library which is using QT and also supports Windows platform. Finally I was
able to run it on Windows (partially).
There are several most commonly used tools:
cmake: &#8220;build system&#8221; &#8211; attempt to have cross platform &#8220;make&#8221; functionality.
Theoretically all IDEs in the future should support loading, [...]]]></description>
		<wfw:commentRss>http://alexkr.com/posts/147/cmake-nmake-qmake-and-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing shared counter with ACE</title>
		<link>http://alexkr.com/posts/146/implementing-shared-counter-with-ace/</link>
		<comments>http://alexkr.com/posts/146/implementing-shared-counter-with-ace/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 15:48:13 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[short]]></category>
		<category><![CDATA[ace]]></category>
		<category><![CDATA[cpp]]></category>

		<guid isPermaLink="false">http://alexkr.com/posts/146/implementing-shared-counter-with-ace/</guid>
		<description><![CDATA[Recently I came across a specific issue while working with ACE_Atomic_Op on ACE build &#8220;5.4.6&#8243;.
The problem is that although ACE_Atomic_Op gives an access to the underlying synchronization object but still it is deprecated and causes deadlock.
ACE_Atomic_Op_Ex must be used instead.
Most probably it is specific to my configuration with Red Hat 3.2.3 (kernel 2.4.21) with ACE [...]]]></description>
		<wfw:commentRss>http://alexkr.com/posts/146/implementing-shared-counter-with-ace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ACE_Reactor initialization</title>
		<link>http://alexkr.com/posts/139/ace_reactor-initialization/</link>
		<comments>http://alexkr.com/posts/139/ace_reactor-initialization/#comments</comments>
		<pubDate>Sat, 10 May 2008 14:46:54 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[short]]></category>
		<category><![CDATA[ace]]></category>
		<category><![CDATA[cpp]]></category>

		<guid isPermaLink="false">http://alexkr.com/posts/139/ace_reactor-initialization/</guid>
		<description><![CDATA[I faced the problem when ACE_Reactor::run_reactor_event_loop() returned -1 with errno == 0.

This happened only on Linux while Windows code works pretty fine.

My ACE version is 5.4.6 and Linux is Red Hat with gcc 3.2.3

So as turns out that if ace reactor is used in its very default way:


   ACE_Reactor reactor;
    [...]]]></description>
		<wfw:commentRss>http://alexkr.com/posts/139/ace_reactor-initialization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Iterating a map in ACE</title>
		<link>http://alexkr.com/posts/138/iterating-a-map-in-ace/</link>
		<comments>http://alexkr.com/posts/138/iterating-a-map-in-ace/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 16:55:05 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[short]]></category>
		<category><![CDATA[ace]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[multithreading]]></category>

		<guid isPermaLink="false">http://alexkr.com/posts/138/iterating-a-map-in-ace/</guid>
		<description><![CDATA[STL containers are not thread safe but ACE containers support synchronization.
Consider you are using containers like std::map in multi threaded environment.
Normally there must be a critical section or a mutex which protects access to the container.
STL implementations do not provide such mechanism by default so C++ programmers must implement it.
ACE library has very flexible way [...]]]></description>
		<wfw:commentRss>http://alexkr.com/posts/138/iterating-a-map-in-ace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nested classes have access to private members</title>
		<link>http://alexkr.com/posts/136/nested_class_access/</link>
		<comments>http://alexkr.com/posts/136/nested_class_access/#comments</comments>
		<pubDate>Sat, 16 Feb 2008 16:36:33 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[short]]></category>
		<category><![CDATA[cpp]]></category>

		<guid isPermaLink="false">http://alexkr.com/posts/136/136/</guid>
		<description><![CDATA[Consider the following code:


class A{
public:
    class B{
    public:
    void useA(A * pA){
       pA->m_int = 23;
    }
};
private:
    int m_int;
};
int main(){
    A a;
    A::B b;
    b.useA(&#038;a);
  [...]]]></description>
		<wfw:commentRss>http://alexkr.com/posts/136/nested_class_access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some C++ fun with 2 in power N</title>
		<link>http://alexkr.com/source-code/134/some-c-fun-with-2-in-power-n/</link>
		<comments>http://alexkr.com/source-code/134/some-c-fun-with-2-in-power-n/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 16:22:21 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[cpp]]></category>

		<guid isPermaLink="false">http://alexkr.com/source-code/134/some-c-fun-with-2-in-power-n/</guid>
		<description><![CDATA[There is one very famous task to design an algorithm which calculates 2 in power N.

Obvious solution will require N operations so it is not something we are thinking about.

If you look at the example: 2^6 = 2*2*2*2*2*2 you will notice that it can be done faster: 2^6 = (2^3)*(2^3).

in other words:


long compute2N(long n)
{
	if (n==0) [...]]]></description>
		<wfw:commentRss>http://alexkr.com/source-code/134/some-c-fun-with-2-in-power-n/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Loading VS 2008 solution files on VS 2004</title>
		<link>http://alexkr.com/posts/130/loading-vs-2008-solution-files-on-vs-2004/</link>
		<comments>http://alexkr.com/posts/130/loading-vs-2008-solution-files-on-vs-2004/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 16:16:49 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[short]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://alexkr.com/posts/130/loading-vs-2008-solution-files-on-vs-2004/</guid>
		<description><![CDATA[Visual Studio 2004 won&#8217;t open solution files generated by newer IDE like Visual Studio 2008.
But if you really needed it, you can apply the following trick.

First of all, this is a dirty hack and in some circumstances resulting solution will not be identical to the original one.
So, the idea is that one can open all [...]]]></description>
		<wfw:commentRss>http://alexkr.com/posts/130/loading-vs-2008-solution-files-on-vs-2004/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

