http://groups.google.com/group/comp.lang.c++?hl=en
comp.lang.c++@googlegroups.com
Today's topics:
* What is the correct template syntax for this? - 3 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/01e2a40e6b1406d3?hl=en
* MiLi: minimalistic libraries - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/b1131a9d2fb69df5?hl=en
* Funciton with function pointer argument - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/c00c1cdf120d3584?hl=en
* Corrected: Proposal: Increasing type safety with a keyword - 2 messages, 1
author
http://groups.google.com/group/comp.lang.c++/t/9cce4bef7f79a39b?hl=en
* Good News! Free Shipping! world famous bags(D&G bag LV HERMES Gucci JIMMY
THOO True leather AAA )Wholesale (www.salewto.com ) - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/7dcee21d616e414f?hl=en
* PORTING Applications from 32 bit to 64 bit Architecture - 2 messages, 2
authors
http://groups.google.com/group/comp.lang.c++/t/3fc395032a4427d0?hl=en
* Writing (N)RVO friendly code. - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/6d1fbeefad44b436?hl=en
* Pruning a std::map efficiently? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/f45ae8609ee5b84c?hl=en
* Alf P. Steinbach's pointer tutorial - 5 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/07cb5765eabf8024?hl=en
* Handling large text streams of integers - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/5ef7335840714596?hl=en
* simple test of main signature fails - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/b6e9ea6fafe7a0f0?hl=en
* Eclipse & include file - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/03855515fb3c1bbf?hl=en
* Remove Data from basic::string - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/8dfcfccc50d764ee?hl=en
==============================================================================
TOPIC: What is the correct template syntax for this?
http://groups.google.com/group/comp.lang.c++/t/01e2a40e6b1406d3?hl=en
==============================================================================
== 1 of 3 ==
Date: Wed, Apr 1 2009 5:10 am
From: Triple-DES
On 1 Apr, 12:52, SG <s.gesem...@gmail.com> wrote:
> On 1 Apr., 12:37, ZikO <ze...@op.pl> wrote:
>
>
>
>
>
> > SG wrote:
> > > Yes. Have you tried the namespace scope? :-p
>
> > > struct S
> > > {
> > > template<int N>
> > > void foo(int k);
> > > };
>
> > > template<int N>
> > > void S::foo(int k) {}
>
> > > template<>
> > > void S::foo<0>(int k) {}
>
> > > Cheers!
> > > SG
>
> > Is this also possible for the template function in the template class ?
>
> You mean "function template" and "class template". The answer is
> yes. It's something along the lines of
>
> template<typename T>
> template<int N>
> void S<T>::foo(int k) {}
>
> template<typename T>
> template<>
> void S<T>::foo<0>(int k) {}
The second example is ill-formed. A member template can not be
explicitly (fully) specialized unless the enclosing class template is
also explicitly (fully) specialized.
template<>
template<>
void S<int>::foo<0>(int k) {} // ok
template<>
template<int N>
void S<int>::foo<0>(int k) {} // ok
template<typename T>
template<>
void S<T>::foo<0>(int k) {} // ill-formed
== 2 of 3 ==
Date: Wed, Apr 1 2009 5:12 am
From: Triple-DES
On 1 Apr, 14:10, Triple-DES <DenPlettf...@gmail.com> wrote:
> On 1 Apr, 12:52, SG <s.gesem...@gmail.com> wrote:
>
>
>
>
>
> > On 1 Apr., 12:37, ZikO <ze...@op.pl> wrote:
>
> > > SG wrote:
> > > > Yes. Have you tried the namespace scope? :-p
>
> > > > struct S
> > > > {
> > > > template<int N>
> > > > void foo(int k);
> > > > };
>
> > > > template<int N>
> > > > void S::foo(int k) {}
>
> > > > template<>
> > > > void S::foo<0>(int k) {}
>
> > > > Cheers!
> > > > SG
>
> > > Is this also possible for the template function in the template class ?
>
> > You mean "function template" and "class template". The answer is
> > yes. It's something along the lines of
>
> > template<typename T>
> > template<int N>
> > void S<T>::foo(int k) {}
>
> > template<typename T>
> > template<>
> > void S<T>::foo<0>(int k) {}
>
> The second example is ill-formed. A member template can not be
> explicitly (fully) specialized unless the enclosing class template is
> also explicitly (fully) specialized.
>
> template<>
> template<>
> void S<int>::foo<0>(int k) {} // ok
>
> template<>
> template<int N>
> void S<int>::foo<0>(int k) {} // ok
^^^^
should be "foo<N>", of course
== 3 of 3 ==
Date: Wed, Apr 1 2009 7:12 am
From: Andrey Tarasevich
fabio_cannizzo@yahoo.com wrote:
> The following syntax cause gcc to complain about:
> - explicit specialization in non-namespace scope
> - enclosing class templates are not explicitly specialized
>
> So I guess that I need to put the specialization of foo<0> somewhere
> out of the class definition, but what is the correct syntax to do
> that?
>
> Thanks a lot
>
> template <class A>
> class MyClass
> {
> template <unsigned char N>
> void foo( sie_t int ) { /* ... */ }
>
> template <>
> void foo<0>( sie_t int ) { /* ... */ }
> };
>
There's no immediate correct syntax for this. Explicit specialization of
a member template without explicit specialization of enclosing template
is not allowed in C++.
If the inner template was a class template, you could've worked around
this limitation by introducing a dummy parameter and using partial
specialization instead of explicit one. So, you can try wrapping your
'foo' into a class (as a static member) and applying this workaround
template <class A>
class MyClass
{
template <unsigned char N, unsigned char DUMMY = 0>
struct S
{
static void foo( int x ) { /* ... */ }
};
template <unsigned char DUMMY>
struct S<0, DUMMY>
{
static void foo( int x ) { /* ... */ }
};
};
This looks like workaround on workaround, and is generally ugly, but it
works.
--
Best regards,
Andrey Tarasevich
==============================================================================
TOPIC: MiLi: minimalistic libraries
http://groups.google.com/group/comp.lang.c++/t/b1131a9d2fb69df5?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Apr 1 2009 5:29 am
From: dgutson
In the hope that this may be useful: MiLi is a collection of 1-header-
only libraries.
http://mili.googlecode.com
Daniel.
==============================================================================
TOPIC: Funciton with function pointer argument
http://groups.google.com/group/comp.lang.c++/t/c00c1cdf120d3584?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Apr 1 2009 5:41 am
From: Vladyslav Lazarenko
On Apr 1, 1:05 am, oalfishcivil <yuefei...@gmail.com> wrote:
> On Mar 31, 3:16 pm, Andrey Bulat <andrey.bu...@gmail.com> wrote:
>
>
>
>
>
> > On Mar 31, 8:50 pm, Andrey Tarasevich <andreytarasev...@hotmail.com>
> > wrote:
>
> > > Vladyslav Lazarenko wrote:
> > > > On Mar 31, 12:42 pm, oalfishcivil <yuefei...@gmail.com> wrote:
> > > >> I have a function double solver(double (*pf)(double), double tol)
> > > >> However, it would be nice if solver could work for function
> > > >> double func(double x,double para) since the codes are similar.
> > > >> How could I do that? Thanks
>
> > > > 1) Create the base function: "double solver(double x, double para)"
> > > > 2) Move implementation from "double solver(double (*pf)(double),
> > > > double tol)" except invocation of the function pointed by "pf" to that
> > > > function.
> > > > 3) Change "double solver(double (*pf)(double), double tol)" function
> > > > to call "double solver(double x, double para)" with x = result of
> > > > invocation of the function pointed by "pf".
>
> > > Usually, a callback-based interface implies that the callback function
> > > needs to be called repeatedly from the 'solver' function, each time with
> > > different arguments and different results. In general case there's no
> > > way to replace all these invocations with a single invocation in
> > > advance. If that were possible, there probably wouldn't be a callback
> > > there in the first place.
>
> > > --
> > > Best regards,
> > > Andrey Tarasevich
>
> > I can propose for discussion following simple sample:
>
> > class Functor2
> > {
> > public:
> > Functor2(int A, int B): a(A),b(B){}
> > int a;
> > int b;
> > virtual int operator()()
> > {
> > return b;
> > }
>
> > };
>
> > class Functor1: public Functor2
> > {
> > public:
> > Functor1(int A): Functor2(A, 0){}
> > virtual int operator()()
> > {
> > return a;
> > }
>
> > };
>
> > int solver(Functor2* p, int d)
> > {
> > return (*p)() + d;
>
> > }
>
> > int main()
> > {
> > Functor1 f1(5);
> > Functor2 f2(3,2);
> > int ret;
> > ret = solver(&f1, 7);
> > ret = solver(&f2, 7);
>
> > }
>
> > As for me it is more valuable construction versus global variable (and
> > much more readeble).
> > (It works on VS2008)
>
> > Best wishes
> > Andrey Bulat
>
> Really appreciate your example and others' suggestions. I am writing a
> code use bisection method to find roots in given bounds for
> functions like double func(double x) or double func(double x,double
> para). Since I have several different such functions, I want to write
> a bisection method function which can take this functions as argument
> instead of adding the bisection method in each function which will
> produce a lot more repetitive codes. I think your method here would
> work for me although it's not that elegant(not your fault). Thanks
> Yuefei
Just a friendly suggestion - use templates instead of polymorphism.
==============================================================================
TOPIC: Corrected: Proposal: Increasing type safety with a keyword
http://groups.google.com/group/comp.lang.c++/t/9cce4bef7f79a39b?hl=en
==============================================================================
== 1 of 2 ==
Date: Wed, Apr 1 2009 5:53 am
From: Ioannis Vranos
Thomas J. Gritzan wrote:
> First, I think your comment is wrong:
> "The new use of "auto" in upcoming C++0x, is a weak typing approach,
> while "only" keyword is a strong typing approach."
>
> The new "auto" is not less a strong typing approach than before (without
> auto). You still can't change the type of a variable after declaration.
> What "auto" does is called "type inference". It deduces the type of the
> declared variable by the type of its initializer.
I have updated http://www.cpp-software.net/documents/cpp_only_proposal.html
Take a look there for an explanation.
> Second, take a look at another proposal, for example the lambda proposal:
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1968.pdf
>
> Your proposal still lacks a motivation part (1.1 in the above) that
> talks about **which problems you want to solve** with this solution, and
> another part, which discusses why a simple library solution (some where
> suggested) isn't good enough.
A small example how increased type safety helps us:
only double somefunc()
{
double value= 1.0;
// Perform some operations
return value;
}
int main()
{
int x= somefunc(); // The compiler catches the error (type mismatch).
}
The proposal solves the problem of reduced type-safety, and aims to become a completely type-safe solution,
without changing the use of existing features.
For more info, and an example of a complete type safe program, check the proposal web page:
http://www.cpp-software.net/documents/cpp_only_proposal.html
== 2 of 2 ==
Date: Wed, Apr 1 2009 6:02 am
From: Ioannis Vranos
Thomas J. Gritzan wrote:
> Ioannis Vranos wrote:
>
>> Yes, the proposal is under construction and doesn't cover all situations
>> yet, however I think only
>>
>> only const char * const p = "Hello, world!";
>>
>> should compile, in this case (when we want to use the keyword "only").
>
> But it won't because string literals are of type < const char[] >.
The code:
const char * const p = "Hello, world!";
is valid C++98/03.
> But a void pointer often is used pointing to raw memory, like in memory
> allocators. Why do you want to propose a general type safety mechanism
> and then forbid any useful usage?
The void pointers were designed to point anywhere. Assigning a void pointer value to another type pointer
variable, always requires a cast under C+98/03, and keyword "only" will not interfere with that.
In other words, void pointers are designed to be unsafe (they point to an object of *any* type), so they
cannot be used together with keyword "only".
==============================================================================
TOPIC: Good News! Free Shipping! world famous bags(D&G bag LV HERMES Gucci
JIMMY THOO True leather AAA )Wholesale (www.salewto.com )
http://groups.google.com/group/comp.lang.c++/t/7dcee21d616e414f?hl=en
==============================================================================
== 1 of 2 ==
Date: Wed, Apr 1 2009 6:10 am
From: fjrj001@163.com
Discount VERSACE True leather AAA Wholesale
(www.salewto.com)
Discount VERSACE bags Wholesale (www.salewto.com)
Discount Chanel Purse Wholesale (www.salewto.com)
Discount CHANEL bags Wholesale (www.salewto.com)
Discount CHANEL True leather AAA Wholesale (www.salewto.com)
Discount PRADA Purse Wholesale (www.salewto.com)
Discount PRADA bags Wholesale (www.salewto.com)
Discount PRADA True leather AAA Wholesale (www.salewto.com)
Discount GUCCI Purse Wholesale (www.salewto.com)
Discount GUCCI True leather AAA Wholesale (www.salewto.com)
Discount Gucci bags Wholesale (www.salewto.com)
Discount Gucci Purse True leather AAA Wholesale
(www.salewto.com)
Discount Gucci bag Wholesale (www.salewto.com)
Discount BURBERRY Purse Wholesale (www.salewto.com)
Discount BURBERRY bags Wholesale (www.salewto.com)
Discount pauesmitl bags Wholesale (www.salewto.com)
Discount HERMES True leather AAA Wholesale (www.salewto.com)
Discount HERMES Purse True leather AAA Wholesale
(www.salewto.com)
Discount HERMES bags Wholesale (www.salewto.com)
Discount LV bags Wholesale (www.salewto.com)
Discount LV Purse True leather AAA Wholesale
(www.salewto.com)
Discount LV Purse Wholesale (www.salewto.com)
Discount LV True leather AAA Wholesale (www.salewto.com)
Discount D&G bag Wholesale (www.salewto.com)
Discount D&G Purse Wholesale (www.salewto.com)
Discount D&G bags Wholesale (www.salewto.com)
Discount D&G Purse True leather AAA Wholesale
(www.salewto.com)
Discount ED Purse Wholesale (www.salewto.com)
Discount EDHardy bags Wholesale (www.salewto.com)
Discount UGG bag Wholesale (www.salewto.com)
Discount CHLOE True leather AAA Wholesale (www.salewto.com)
Discount CHLOE bags Wholesale (www.salewto.com)
Discount Chloe Purse True leather AAA Wholesale
(www.salewto.com)
Discount JIMMY CHOO Purse True leather AAA Wholesale
(www.salewto.com)
Discount JIMMYTOO bags Wholesale (www.salewto.com)
Discount JIMMY THOO True leather AAA Wholesale
(www.salewto.com)
Discount paul smith bags Wholesale (www.salewto.com)
More detail land, address:www.salewto.com
== 2 of 2 ==
Date: Wed, Apr 1 2009 6:53 am
From: salewto
Discount VERSACE True leather AAA Wholesale
(www.salewto.com)
Discount VERSACE bags Wholesale (www.salewto.com)
Discount Chanel Purse Wholesale (www.salewto.com)
Discount CHANEL bags Wholesale (www.salewto.com)
Discount CHANEL True leather AAA Wholesale (www.salewto.com)
Discount PRADA Purse Wholesale (www.salewto.com)
Discount PRADA bags Wholesale (www.salewto.com)
Discount PRADA True leather AAA Wholesale (www.salewto.com)
Discount GUCCI Purse Wholesale (www.salewto.com)
Discount GUCCI True leather AAA Wholesale (www.salewto.com)
Discount Gucci bags Wholesale (www.salewto.com)
Discount Gucci Purse True leather AAA Wholesale
(www.salewto.com)
Discount Gucci bag Wholesale (www.salewto.com)
Discount BURBERRY Purse Wholesale (www.salewto.com)
Discount BURBERRY bags Wholesale (www.salewto.com)
Discount pauesmitl bags Wholesale (www.salewto.com)
Discount HERMES True leather AAA Wholesale (www.salewto.com)
Discount HERMES Purse True leather AAA Wholesale
(www.salewto.com)
Discount HERMES bags Wholesale (www.salewto.com)
Discount LV bags Wholesale (www.salewto.com)
Discount LV Purse True leather AAA Wholesale
(www.salewto.com)
Discount LV Purse Wholesale (www.salewto.com)
Discount LV True leather AAA Wholesale (www.salewto.com)
Discount D&G bag Wholesale (www.salewto.com)
Discount D&G Purse Wholesale (www.salewto.com)
Discount D&G bags Wholesale (www.salewto.com)
Discount D&G Purse True leather AAA Wholesale
(www.salewto.com)
Discount ED Purse Wholesale (www.salewto.com)
Discount EDHardy bags Wholesale (www.salewto.com)
Discount UGG bag Wholesale (www.salewto.com)
Discount CHLOE True leather AAA Wholesale (www.salewto.com)
Discount CHLOE bags Wholesale (www.salewto.com)
Discount Chloe Purse True leather AAA Wholesale
(www.salewto.com)
Discount JIMMY CHOO Purse True leather AAA Wholesale
(www.salewto.com)
Discount JIMMYTOO bags Wholesale (www.salewto.com)
Discount JIMMY THOO True leather AAA Wholesale
(www.salewto.com)
Discount paul smith bags Wholesale (www.salewto.com)
More detail land, address:www.salewto.com
==============================================================================
TOPIC: PORTING Applications from 32 bit to 64 bit Architecture
http://groups.google.com/group/comp.lang.c++/t/3fc395032a4427d0?hl=en
==============================================================================
== 1 of 2 ==
Date: Wed, Apr 1 2009 6:30 am
From: Victor Bazarov
Pallav singh wrote:
> Hi
What's wrong? You post an almost identical article three minutes (!)
apart. Are you impatient to get a reply? Well, this isn't a chat room.
Are you experiencing problems? Contact your ISP. Please refrain from
polluting the cyberspace.
> are these only the changes we need to do while porting application
> from 32 bit architecture to 64 bit architecture ??
>
> In 64 bit architecture, Address is 64 bit but integer is still 32 bit
No, not necessarily. Besides, there are different integers in C++, some
are 32 bit, some are 16 bit, and some even 8 bit (signed char, for
example). It is all platform-specific.
> [.. long list of "only" changes ..]
I strongly recommend that you ask your platform-specific question in the
newsgroup dedicated to your platform.
Generally speaking, your program needs to be written in such a way that
it does not depend on the *size* of the data it operates, or the
endianness of the storage. Then you have no problems shifting from one
environment to the next.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
== 2 of 2 ==
Date: Wed, Apr 1 2009 6:47 am
From: SG
On 1 Apr., 15:30, Victor Bazarov <v.Abaza...@comAcast.net> wrote:
> Generally speaking, your program needs to be written in such a way that
> it does not depend on the *size* of the data it operates, or the
> endianness of the storage. Then you have no problems shifting from one
> environment to the next.
Or even shorter:
non-portable <=> dependence on implementation-defined behaviour
I think that catches it. Of course, the trick is then to know what
part of C++ is implementation-defined.
Cheers!
SG
==============================================================================
TOPIC: Writing (N)RVO friendly code.
http://groups.google.com/group/comp.lang.c++/t/6d1fbeefad44b436?hl=en
==============================================================================
== 1 of 3 ==
Date: Wed, Apr 1 2009 6:20 am
From: Vaclav Haisman
Hi,
are there any guide lines for writing (N)RVO friendly code? E.g. is the
following (N)RVO friendly?
S foo ()
{
S s;
s.frob (1);
return s;
}
--
VH
== 2 of 3 ==
Date: Wed, Apr 1 2009 6:32 am
From: Jeff Schwab
Vaclav Haisman wrote:
> Hi,
> are there any guide lines for writing (N)RVO friendly code? E.g. is the
> following (N)RVO friendly?
>
> S foo ()
> {
> S s;
> s.frob (1);
> return s;
> }
NRVO yes, RVO no, IIUC.
== 3 of 3 ==
Date: Wed, Apr 1 2009 7:12 am
From: SG
On 1 Apr., 15:20, Vaclav Haisman <v.hais...@sh.cvut.cz> wrote:
> Hi,
> are there any guide lines for writing (N)RVO friendly code? E.g. is the
> following (N)RVO friendly?
>
> S foo ()
> {
> S s;
> s.frob (1);
> return s;
> }
Just an observation I'd like to share: Assuming frob returns "*this"
there's a difference between
s.frob (1);
return s;
and
return s.frob (1);
because the 2nd case probably disables NRVO unless the compiler
inlines the function and is smart enough to figure out that the
returned reference actually refers to 's'.
That's the reason why I usually write
T operator+(T const& a, T const& b)
{
T r = a;
r += b;
return r;
}
instead of
T operator+(T const& a, T const& b)
{
T r = a;
return r += b;
}
for some custom "arithmetic-like" type T.
Cheers!
SG
==============================================================================
TOPIC: Pruning a std::map efficiently?
http://groups.google.com/group/comp.lang.c++/t/f45ae8609ee5b84c?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Apr 1 2009 6:41 am
From: Jorgen Grahn
On Wed, 1 Apr 2009 03:59:28 -0700 (PDT), alasham.said@gmail.com <alasham.said@gmail.com> wrote:
> Hello,
>
> This could be one implementation: copy_if is not part of the standard
> library, but is easy to implement (see The C++ Programming Language)
>
> template<typename In, typename Out, typename Pred>
> Out copy_if(In first, In last, Out res, Pred Pr)
...
>
> It is then possible to copy from map m1 to m2, applying predicate
> Pred:
>
> copy_if( m1.begin(), m1.end(), std::inserter( m2, m2.begin() ),
> Pred );
Thanks, but it's not really what I asked for. That was part of my
fallback solution, which I knew how to implement, but felt was
suboptimal.
Three things I noted while going down that road:
- std::copy_if() doesn't exist, but std::remove_copy_if() does,
and has the same semantics except the predicate must be negated.
I am a bit surprised Stroustrup didn't mention that.
- It doesn't help me, since back_inserter doesn't work on std::map. Or
is there another way to fill a std::map via std::remove_copy_if()?
- But the loop is trivial enough in this case, and I can
build my new tree more efficiently using the hinted
m.insert(m.end(), val) -- by a factor 5 in my experiments.
/Jorgen
--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.se> R'lyeh wgah'nagl fhtagn!
==============================================================================
TOPIC: Alf P. Steinbach's pointer tutorial
http://groups.google.com/group/comp.lang.c++/t/07cb5765eabf8024?hl=en
==============================================================================
== 1 of 5 ==
Date: Wed, Apr 1 2009 6:48 am
From: "Alf P. Steinbach"
* Bob R, on Aug 16 2007:
> arnuld <geek.arn...@gmail.com> wrote in message...
>> there is a tutorial written by Alf P. Steinbach titled something like
>> "Pointers in C++". i even Googled for that but was not able to find it.
>> can anyone tell me where i can find it. IIRC, it was in pdf format and on
>> 1st page there was a small dog pointing his finger to somewhere (to show
>> the conecept of pointers)
>
> This is the last place I knew it to be:
>
> Alf P. Steinbach's "Pointers" document:
> http://home.no.net/dubjai/win32cpptut/special/pointers/ch_01.pdf
>
> [ Alf, please let us know if it's been moved.]
The location above is on free hosting that will be terminated 1. May 2009.
The same document is now available at
<url: http://alfps.izfree.com/tutorials/pointers/>
By the way, I haven't found any Google search that will turn up that page. The
closest I get is pages that refer to the old location, mostly this old thread
archived everywhere, but also some similar threads, plus a ref from Wikipedia.
This is surprising to me since Mr. GoogleBot is a frequent visitor.
Cheers,
- Alf
PS: Dang, I clicked on the wrong group and posted this to
[comp.lang.c++.moderated], making me guilty of the sin of multi-posting. But OK,
it doesn't matter. At least *this* is now in the right group! :-)
--
Due to hosting requirements I need visits to <url: http://alfps.izfree.com/>.
No ads, and there is some C++ stuff! :-) Just going there is good. Linking
to it is even better! Thanks in advance!
== 2 of 5 ==
Date: Wed, Apr 1 2009 7:26 am
From: Victor Bazarov
Alf P. Steinbach wrote:
> [..]
> By the way, I haven't found any Google search that will turn up that
> page. The
> closest I get is pages that refer to the old location, mostly this old
> thread
> archived everywhere, but also some similar threads, plus a ref from
> Wikipedia.
> This is surprising to me since Mr. GoogleBot is a frequent visitor.
Have you paid him? Or do you expect your stuff would interest him? :-)
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
== 3 of 5 ==
Date: Wed, Apr 1 2009 7:35 am
From: "Alf P. Steinbach"
* Victor Bazarov:
> Alf P. Steinbach wrote:
>> [..]
>> By the way, I haven't found any Google search that will turn up that
>> page. The
>> closest I get is pages that refer to the old location, mostly this old
>> thread
>> archived everywhere, but also some similar threads, plus a ref from
>> Wikipedia.
>> This is surprising to me since Mr. GoogleBot is a frequent visitor.
>
> Have you paid him?
No. Does anybody?
> Or do you expect your stuff would interest him? :-)
Yup. :-)
Cheers,
- Alf
--
Due to hosting requirements I need visits to <url: http://alfps.izfree.com/>.
No ads, and there is some C++ stuff! :-) Just going there is good. Linking
to it is even better! Thanks in advance!
== 4 of 5 ==
Date: Wed, Apr 1 2009 7:47 am
From: Sherm Pendley
"Alf P. Steinbach" <alfps@start.no> writes:
> The same document is now available at
>
> <url: http://alfps.izfree.com/tutorials/pointers/>
>
> By the way, I haven't found any Google search that will turn up that page. The
> closest I get is pages that refer to the old location, mostly this old thread
> archived everywhere, but also some similar threads, plus a ref from Wikipedia.
> This is surprising to me since Mr. GoogleBot is a frequent visitor.
Have you configured the old URL to return a "301 Moved Permanently" status
that redirects to the new one?
sherm--
--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
== 5 of 5 ==
Date: Wed, Apr 1 2009 7:53 am
From: "Alf P. Steinbach"
* Sherm Pendley:
> "Alf P. Steinbach" <alfps@start.no> writes:
>
>> The same document is now available at
>>
>> <url: http://alfps.izfree.com/tutorials/pointers/>
>>
>> By the way, I haven't found any Google search that will turn up that page. The
>> closest I get is pages that refer to the old location, mostly this old thread
>> archived everywhere, but also some similar threads, plus a ref from Wikipedia.
>> This is surprising to me since Mr. GoogleBot is a frequent visitor.
>
> Have you configured the old URL to return a "301 Moved Permanently" status
> that redirects to the new one?
It will be (I hope), but that depends on start.no, the host.
Cheers,
- Alf
--
Due to hosting requirements I need visits to <url: http://alfps.izfree.com/>.
No ads, and there is some C++ stuff! :-) Just going there is good. Linking
to it is even better! Thanks in advance!
==============================================================================
TOPIC: Handling large text streams of integers
http://groups.google.com/group/comp.lang.c++/t/5ef7335840714596?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Apr 1 2009 6:51 am
From: Jorgen Grahn
On Wed, 1 Apr 2009 01:09:27 -0700 (PDT), James Kanze <james.kanze@gmail.com> wrote:
> On Apr 1, 8:47 am, Jorgen Grahn <grahn+n...@snipabacken.se> wrote:
...
>> I am obviously too lazy to check what the standard says about
>> std::numeric_limits<std::streamsize>::max(), but I hope it's
>> just a case of unfortunate naming and that it has to do with
>> seekable streams only (like James hinted at elsewhere).
>
>> I'd be very disappointed if you couldn't use iostreams with
>> "infinite streams", which (on Unix) includes pipes, (TCP)
>> sockets, /dev/random, ... I expect to be able to use
>> std::cin/cerr constantly for years.
>
> Given that the standard doesn't require support for such
> things, it doubtlessly doesn't say anything.
Yes, I should have written "I'd be very disappointed /with my
compiler/ if I couldn't use iostreams with 'infinite streams' ...".
/Jorgen
--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.se> R'lyeh wgah'nagl fhtagn!
==============================================================================
TOPIC: simple test of main signature fails
http://groups.google.com/group/comp.lang.c++/t/b6e9ea6fafe7a0f0?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Apr 1 2009 7:38 am
From: Comp1597@yahoo.co.uk
On Visual Studio 2008 Express, I compiled and ran the following
program:
#include "stdafx.h"
#include <iostream>
int main(int argc, char * argv[])
{
std::cout << argc;
}
At the Visual Studio Command Prompt, I entered ProjectName.exe(3, "a",
"b", "c")
My thinking was that argc denotes the number of string arguments to
the main function. This is indicated by the 3 strings "a", "b" and
"c" and by the first integer parameter which I set to 3.
So I expected that argc==3 and that therefore the output would be 3.
However, the output was 2
I'd be grateful if someone could explain this.
Thanks in advance.
==============================================================================
TOPIC: Eclipse & include file
http://groups.google.com/group/comp.lang.c++/t/03855515fb3c1bbf?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Apr 1 2009 7:39 am
From: Jorgen Grahn
On Wed, 1 Apr 2009 03:42:01 -0700 (PDT), unlexx <unlexx@gmail.com> wrote:
>
> Ubuntu 8.10 -- Intrepid
> Eclipse 3.4 (Ganymede)
>
> /../
> #include <string>
> #include <vector>
> #include <libpq-fe.h>
> /../
>
> Project ->> build ALL
> libpq-fe.h: No such file or directory
>
>
> However
> ls -l /usr/include/postgresql/libpq-fe.h
> -rw-r--r-- 1 root root 18410 2009-02-11 01:55 /usr/include/postgresql/
> libpq-fe.h
> Why Eclipse no included file? No work operate directories recursively?
> or error in declared include?
If I were you I'd write
#include <postgresql/libpq-fe.h>
no matter if I used Eclipse, Emacs, Vi or MS Notepad. It tells the
reader what "libpq-fe.h" is. (I have to say that sounds like an
unusually badly chosen include file name.)
/Jorgen
--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.se> R'lyeh wgah'nagl fhtagn!
==============================================================================
TOPIC: Remove Data from basic::string
http://groups.google.com/group/comp.lang.c++/t/8dfcfccc50d764ee?hl=en
==============================================================================
== 1 of 3 ==
Date: Wed, Apr 1 2009 7:41 am
From: mrc2323@cox.net (Mike Copeland)
What is a good way to remove a character from a basic::string?
For example, I have the following:
basic::string myString = "123 E, Main Street";
and I wish to remove (delete) the "," from it.
Does anyone know a way to do this? TIA
== 2 of 3 ==
Date: Wed, Apr 1 2009 7:50 am
From: ram@zedat.fu-berlin.de (Stefan Ram)
mrc2323@cox.net (Mike Copeland) writes:
>basic::string myString = "123 E, Main Street";
>and I wish to remove (delete) the "," from it.
The details depends on missing parts of the problem
specification. For example, to delete the »,« at compile time,
change the source code to
basic::string myString = "123 E Main Street";
. A function to delete the »,« at run-time depends on the
range of permissible values for the specification of the
string and the text to be deleted and the intended result or
effect.
I think the best way to pose such a question is to write a
function declaration (but not a function definition) plus
documentation for the function and then to ask for the
implementation. It would even be better if a test client
would be supplied by you, too.
== 3 of 3 ==
Date: Wed, Apr 1 2009 7:51 am
From: tpl@eng.cam.ac.uk (Tim Love)
mrc2323@cox.net (Mike Copeland) writes:
> What is a good way to remove a character from a basic::string?
>For example, I have the following:
> basic::string myString = "123 E, Main Street";
>and I wish to remove (delete) the "," from it.
>Does anyone know a way to do this? TIA
I think the following will work (with a few includes, etc). Up to you whether you think it's a good way.
string::iterator new_end =remove_if(myString.begin(), myString.end(), bind2nd(equal_to<char>(), ','));
myString.erase(new_end, myString.end());
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.lang.c++"
group.
To post to this group, visit http://groups.google.com/group/comp.lang.c++?hl=en
To unsubscribe from this group, send email to comp.lang.c+++unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c++/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
No comments:
Post a Comment