Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
b60ba931
Commit
b60ba931
authored
Feb 21, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
C++ references
Implemented like typedef.
parent
015b5fd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
19 deletions
+13
-19
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+13
-19
No files found.
Cython/Compiler/PyrexTypes.py
View file @
b60ba931
...
...
@@ -1358,43 +1358,37 @@ class CNullPtrType(CPtrType):
is_null_ptr
=
1
class
CReferenceType
(
C
Type
):
class
CReferenceType
(
Base
Type
):
is_reference
=
1
def
__init__
(
self
,
base_type
):
self
.
base_type
=
base_type
self
.
ref_
base_type
=
base_type
def
__repr__
(
self
):
return
"<CReferenceType %s>"
%
repr
(
self
.
base_type
)
return
"<CReferenceType %s>"
%
repr
(
self
.
ref_base_type
)
def
as_argument_type
(
self
):
return
self
def
same_as_resolved_type
(
self
,
other_type
):
return
other_type
.
is_reference
and
self
.
base_type
.
same_as
(
other_type
.
base_type
)
def
declaration_code
(
self
,
entity_code
,
for_display
=
0
,
dll_linkage
=
None
,
pyrex
=
0
):
#print "CReferenceType.declaration_code: pointer to", self.base_type ###
return
self
.
base_type
.
declaration_code
(
return
self
.
ref_
base_type
.
declaration_code
(
"&%s"
%
entity_code
,
for_display
,
dll_linkage
,
pyrex
)
def
assignable_from_resolved_type
(
self
,
other_type
):
if
other_type
is
error_type
:
return
1
elif
other_type
.
is_reference
and
self
.
base_type
==
other_type
.
base_type
:
return
1
elif
other_type
==
self
.
base_type
:
return
1
else
:
#for now
return
0
def
specialize
(
self
,
values
):
base_type
=
self
.
base_type
.
specialize
(
values
)
if
base_type
==
self
.
base_type
:
base_type
=
self
.
ref_
base_type
.
specialize
(
values
)
if
base_type
==
self
.
ref_
base_type
:
return
self
else
:
return
CReferenceType
(
base_type
)
def
__getattr__
(
self
,
name
):
return
getattr
(
self
.
ref_base_type
,
name
)
class
CFuncType
(
CType
):
# return_type CType
# args [CFuncTypeArg]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment