473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Alias for STL object

Xx r3negade
I'm designing a program that frequently deals with coordinate pairs. I've decided to use stl::pair for this purpose. As these are all coordinate pairs, they will all be of type pair<int, int>. My question is, rather than declaring pair<int, int> each time, like seen here:
Expand|Select|Wrap|Line Numbers
  1. pair<int, int> foo;
  2. void bar(pair<int, int>* biz) {
  3. return;
  4. }
  5.  
can I create some kind of alias that would allow me to do this:
Expand|Select|Wrap|Line Numbers
  1. intpair foo;
  2. void bar(intpair* biz) {
  3. return;
  4. }
  5.  
Sep 21 '08 #1
2 1718
Ganon11
3,652 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. typedef std::pair<int, int> intpair;
might work.
Sep 21 '08 #2
Laharl
849 Expert 512MB
It does work, I just tested it.
Sep 21 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bill Kratzer | last post by:
Hi... I am currently working on a Java-based product that is backed by PostgreSQL (among other databases). I have noticed that PostgreSQL appears to truncate column alias names after 31...
3
by: rajdb2 | last post by:
Can we create an alias for a sequence in db2 udb? We can do it in oracle. But the same thing is not working in db2. I can create an alias, but when i am trying to use it, there is an error that the...
7
by: Lance | last post by:
Is there any way to create an import alias that applies to the entire project? For example, lets say that I want "VB" to represent Microsoft.VisualBasic throughout my entire project. Is there...
2
by: KK | last post by:
Hi, How can I create alias for a class object? Please go thru this program to understand the motivation. Class Name; Class Country{ Name list; /*My intension is to have: list - usa list - uk
6
by: rAinDeEr | last post by:
Hi, An alias is an alternate name for a table or a view. Now, suppose I create an alias on a non existent table in the control centre , it gives me a warning but it still creates the alias for...
21
by: Peter Olcott | last post by:
I got the previous alias to std::vector working, and found that it takes up the space of a pointer. I want to find a way to do an alias to a std::vector that does not take up any space. Is there...
5
by: pauldepstein | last post by:
Take the code: int ival = 1024; int &refVal = ival; My text says "a reference is just another name for an object ... we can access refVal through ival ..." I understand this way of using...
4
by: Sean McIlroy | last post by:
hi all is there a way to do this ... class clown: def __init__(self): self.x = 0 self.y = ALIAS(self.x) ## FEASIBLE ? .... so that you get results like this ...
3
by: Jake G | last post by:
Hi, I have elements my page with an "alias" in them e.g. <input type=hidden id="S_SELLOG" name="S_SELLOG" iegAlias="S_SELLOG01" maxlength=1 title="Login/Logout" style="top:0; left:0;"> I am...
4
by: WT | last post by:
Hello, Here is my pb: I have a group of classes in 2 namespaces which are exactly simlilar. Theses classes are generated by Visual Studio when inserting a Web Reference, having 2 versions of a...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.