Was the non-const version passing by reference or not? If it wasn't, it might have needed a copy constructor to call the copy constructor, which really isn't going to work.
Yes, of course it is pass-by-reference. The prototype is
I am experiencing a difficulty undersatnding why my program (C++, HP UNIX) crashes. It crashes only when I build it with -O (+O2) optimization switch (used in aCC compiler). It works ok with +O0 or +O1 optimization.
Also, I see that local variables are shown incorrecly when program is built... (3 Replies)
I have an AIX 64-bit program which uses following from AIX5.3
/usr/lib/libc.a(shr_64.o)
/usr/lib/libpthread.a(shr_xpg5_64.o)
/home/jeet_xp/export/power/usr/lib/libsarpc.a(shr.o)
/unix
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libc_r.a(shr_64.o)
... (3 Replies)
Hello all,
I'm trying to use gethostbyname_r function with 6 arguments in one of my functions. But the call to this crashes the program. Kindly help me in resolving this...
Compiler Info:
Linux target: i686-hardhat-linux
version: 3.3.1
The following is the piece of code I'm trying to... (1 Reply)
Hi,
Could anyone tell me the reason why the following program crashes?
class A {
int x;
public:
A() {
cout << "from A()" << endl;
}
~A() {
cout << "from ~A()" << endl;
}
};
class B : public A {
public:
B() {
cout << "from B()"... (2 Replies)
I am running openSUSE 11.2 with KDE4.5 on my eMachines e525. I just did a "zypper up" on my system and it reported that Chromium was going to be updated. I agreed and the when the update was finished I shut down Chromium and started it again. It flickered on the screen for a moment and crashed.... (6 Replies)
Production server crashes when there is no traffic on it. Can only recover by going to ALOM and reboot the server. This seems to happen about the same time every month. The only good thing is the server is not in production at the time of the crash.
I have been unable to locate any information in... (5 Replies)
Can someone tell my why every time I try to use 7z it freezes my system? I can't move my mouse, I can't type, I can't kill my xsession. I then restart my system and everything returns to normal. When I try to use 7z my system again freezes. (11 Replies)
Hi,
I am a newbie to linux programming. I have implemented msgqueue in C.
msgrcv() call at the client end is as below:
msgrcv( msgqid, msgptr, msgsize, msgtype, 0 );
My program works fine when msgrcv () from /lib/libc.so.6 is called.
However it crashes when __libc_msgrcv() is called.
... (3 Replies)
I am trying to run apcupsd, but it will not retain contact the UPS
root@meow:/home/ethan/UPS/gapcmon-0.8.9# /etc/init.d/apcupsd start
Starting UPS power management:
A copy of the daemon is still running. If you just stopped it,
please wait about 5 seconds for it to shut down.... (0 Replies)
The Apache server suddenly stops. I am running Debian Jessie
Here are some diagnostics:
root@meow:/var/www# apachectl configtest
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress... (4 Replies)
Discussion started by: Meow613
4 Replies
LEARN ABOUT OSX
wx::xsp::xspp
build::Wx::XSP::XSpp(3) User Contributed Perl Documentation build::Wx::XSP::XSpp(3)NAME
XSpp - XS for C++
SYNOPSIS
In Foo.xs (all in one line):
INCLUDE: perl -S wxperl_xspp --typemap=typemap.xsp
Foo.xsp |
OVERVIEW
XS++ is just a thin layer over plain XS, hence to use it you are supposed to know, at the very least, C++ and XS.
This means that you will need typemaps for both xsubpp and xsubppp.
TYPEMAPS
There is nothing special about typemap files (i.e. you can put typemaps directly in your .xsp file), but it is handy to have common
typemaps in a separate file, to avoid duplication.
%typemap{<C++ type>}{simple};
Just let XS++ that this is a valid type, the type will be passed unchanged to XS code except that any "const" qualifiers will be stripped.
%typemap{<C++ type 1>}{parsed}{%<C++ type 2>%};
When "C++ type 1" is used, replace it with "C++ type 2" in the generated XS code.
%typemap{<C++ reference type>}{reference};
Handle C++ references: the XS variable will be declared as a pointer, and it will be explicitly dereferenced in the function call. If it is
used in the return value, the function will create copy of the returned value using a copy constructor.
DESCRIPTION
Anything that does not look like a XS++ directive or a class declaration is passed verbatim to XS. If you want XS++ to ignore code that
looks like a XS++ directive or class declaration, simply surround it with a raw block delimiter like this:
%{
XS++ won't interpret this
%}
%code
See under Classes.
%file
%file{file/path.h};
...
%file{file/path2};
...
%file{-}
By default XS++ output goes to standard output; to change this, use the %file directive; use "-" for standard output.
%module
%module{Module__Name};
Will be used to generate the "MODULE=Module__Name" XS directives.
%name
%name{Perl::Class} class MyClass { ... };
%name{Perl::Func} int foo();
Specifies the perl name under which the C++ class/function will be accessible.
%typemap
See TYPEMAPS above.
Classes
%name{My::Class} class MyClass
{
// can be called in Perl as My::Class->new( ... );
MyClass( int arg );
// My::Class->newMyClass( ... );
%name{newMyClass} MyClass( const char* str, int arg );
// standard DESTROY method
~MyClass();
int GetInt();
void SetValue( int arg = -1 );
%name{SetString} void SetValue( const char* string = NULL );
// Supply a C<CODE:> or C<CLEANUP:> block for the XS
int MyMethod( int a, int b )
%code{% RETVAL = a + b; %}
%cleanup{% /* do something */ %};
};
perl v5.10.0 2008-01-21 build::Wx::XSP::XSpp(3)