comp.lang.c++
  Home FAQ Contact Sign in
comp.lang.c++ only
 
Advanced search
February 2008
motuwethfrsasuw
    123 5
45678910 6
11121314151617 7
18192021222324 8
2526272829   9
2008
 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
  ISO/IEC 9899/AMD1:1995 amendment and C++03         


Author: Ioannis Vranos
Date: Feb 4, 2008 15:41

Does C++03 include the C programming language ISO/IEC 9899/AMD1:1995
amendment?
3 Comments
  C++ is Slow?         


Author: nw
Date: Feb 4, 2008 15:19

Hi all,

I'm constantly confronted with the following two techniques, which I
believe often produce less readable code, but I am told are faster
therefore better. Can anyone help me out with counter examples and
arguments?

1. The STL is slow.

More specifically vector. The argument goes like this:

"Multidimensional arrays should be allocated as large contiguous
blocks. This is so that when you are accessing the array and reach the
end of a row, the next row will already be in the cache. You also
don't need to spend time navigating pointers when accessing the array.
So a 2 dimensional array of size 100x100 should be created like this:

const int xdim=100;
const int ydim=100;

int *myarray = malloc(xdim*ydim*sizeof(int));

and accessed like this:

myarray[xdim*ypos+xpos] = avalue;
Show full article (2.11Kb)
46 Comments
  codecvt.cc:39: error: ISO C++ forbids declaration of `_RWSTD_NAMESPACE_BEGIN' with no type         


Author: wong_powah
Date: Feb 4, 2008 15:08

How to fix this compile error?

# make -f Util/UtilBlock.dep
g++ /opt/aCC/include_std/rw/codecvt.cc -o /opt/aCC/include_std/
rw/codecvt
/opt/aCC/include_std/rw/codecvt.cc:32: error: use of namespace `std'
as
expression
/opt/aCC/include_std/rw/codecvt.cc:39: error: ISO C++ forbids
declaration of `
_RWSTD_NAMESPACE_BEGIN' with no type
/opt/aCC/include_std/rw/codecvt.cc:39: error: syntax error before
`template'
/opt/aCC/include_std/rw/codecvt.cc:43: error: syntax error at end of
input
make: *** [/opt/aCC/include_std/rw/codecvt] Error 1
Show full article (5.97Kb)
2 Comments
  value vs. const ref, char* vs char[4] - part 2         


Author: Rick
Date: Feb 4, 2008 14:58

Is the following appropriate behavior? It certainly isn't what I
expected.

#include

using namespace std;

template bool fun(const T& value) {
cout << "In fun(const T&);" << endl;

}

template bool fun(T value) {
cout << "In fun(T);" << endl;

}

int main(int argc, char** argv) {
fun(static_cast(10) );

}
Show full article (1.05Kb)
5 Comments
  CTC Education         


Author: john
Date: Feb 4, 2008 12:09

Description
CTC Education - The key to educational success, find the best school
for you. Lead generates after a school submission occurs. No incentive-
based web sites, US Leads only.

http://www.checkmystats.com.au/click2.php?id=8626&bid=43345
no comments
  Operator ->* in smart pointers         


Author: Dario Saccavino
Date: Feb 4, 2008 08:12

It seems to me that operator->* is overloadable in C++ (just like
operator->), and it should be useful to implement in smart pointer
classes.

However, I haven't found its implementation either in the standard
weak_ptr class, or in any boost smart pointer. Was it intentionally
left out of those headers?
Actually there's a workaround: just write
(ptr.operator->())->*memptr
instead of
ptr->*memptr
But it looks very ugly. How am I supposed to use member pointers with
smart pointers?

Thank you for your attention

Dario
2 Comments
  static functions         


Author: michael.goossens
Date: Feb 4, 2008 08:06

Alright I am implementing a static member function for the first time
and it is not working :(. Are static member functions implemented in
the header?

header:

static float[4][8] GetPivot(float matrix[4][8], int n);

cpp:

static float[4][8] Matrix4x4::GetPivot(float matrix[4][8], int n) {
...
}

and the errors:
1>c:\users\michaël\documents\visual studio 2005\projects\renderwoman
\renderwoman\matrix4x4.h(12) : error C3409: empty attribute block is
not allowed
1>c:\users\michaël\documents\visual studio 2005\projects\renderwoman...
Show full article (2.94Kb)
4 Comments
  std::map, linear interpolation         


Author: Hicham Mouline
Date: Feb 4, 2008 06:36

hi,

I have a map of data points (xi,yi), modelling a function to
interpolate.
Assuming the points are monotone increasing, such that, i>j, yi> yj if xi>xj
How do i get the inverse of a point y inside the range of yi?

typedef std::map::const_iterator CCI;
CCI endi = f.end();
for (CCI iter=f.begin(); iter!=endi; ++iter)
if (iter->second > x)
break;
if (iter==endi)
return NaN;
CCI prev = iter;
--prev;
if (iter->second = prev->second) // shouldn't happen
return prev->first;
return prev->first + (x - prev->second)*(iter->first -
prev->first)/(iter->second - prev->second);
Show full article (0.75Kb)
2 Comments
  C++ and internationalization/localization         


Author: kasthurirangan.balaji
Date: Feb 4, 2008 05:26

Hi,

I am looking for advice on i18n/l10n using c++. I understand about
wchar & wstreams. I have gone thru the net for some knowledge. All
speak of encodings like utf8/utf16/iso8859 and so. I also see that by
using utf8, we can achieve i18n and l10n using char itself. It would
be great if someone can provide or point out resources in c++ with
lots of example programs. Books are also welcome. References should
speak of persistence, network communications.

Thanks,
Balaji.
2 Comments
  isnan() for complex data         


Author: jacob navia
Date: Feb 4, 2008 02:34

Hi

Has C++ defined the function
isnan() for complex numbers?
What is the definition?

Thanks in advance
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
3 Comments
1 2