Click here to Skip to main content
15,898,978 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralWTL::CHyperLink and WM_CTLCOLORSTATIC Pin
siavan26-Feb-08 2:06
siavan26-Feb-08 2:06 
QuestionHow to implement IEnumString in ATL 3.0 Pin
MANISH RASTOGI25-Feb-08 1:16
MANISH RASTOGI25-Feb-08 1:16 
AnswerRe: How to implement IEnumString in ATL 3.0 Pin
Ernest Laurentin5-Mar-08 4:33
Ernest Laurentin5-Mar-08 4:33 
GeneralRe: How to implement IEnumString in ATL 3.0 Pin
MANISH RASTOGI7-Mar-08 17:50
MANISH RASTOGI7-Mar-08 17:50 
GeneralRe: How to implement IEnumString in ATL 3.0 Pin
Ernest Laurentin10-Mar-08 4:41
Ernest Laurentin10-Mar-08 4:41 
GeneralUsing find_if STL function [modified] Pin
ComplexLifeForm23-Feb-08 10:18
ComplexLifeForm23-Feb-08 10:18 
GeneralRe: Using find_if STL function Pin
Stuart Dootson24-Feb-08 20:57
professionalStuart Dootson24-Feb-08 20:57 
GeneralRe: Using find_if STL function Pin
Stuart Dootson24-Feb-08 21:10
professionalStuart Dootson24-Feb-08 21:10 
A couple of other suggestions re: STL

  • For a simple lookup table, a map would be the preferred container, rather than use a vector of structures:
#include <map>

typedef std::map<double, double> NewPriceLookup;

void x()
{
   double oldprice = 15.0;
   NewPriceLookup npLookup;
   npLookup.insert(std::make_pair(10.0, 12.0));
   npLookup.insert(std::make_pair(12.0, 14.5));
   npLookup.insert(std::make_pair(15.0, 17.0));
   npLookup.insert(std::make_pair(22.0, 26.0));
   npLookup.insert(std::make_pair(30.0, 35.0));
   NewPriceLookup::const_iterator it = npLookup.find(oldprice);
}
If you want to initialise a map, you can use Boost.Assign[^].
  • operator() in function objects should generally be defined to take arguments (especially structs/classes) by const reference rather than by value - it minimizes copying. Also, operator() should in general be const-qualified - it's all part of const-correctness.



GeneralRe: Using find_if STL function Pin
ComplexLifeForm25-Feb-08 0:57
ComplexLifeForm25-Feb-08 0:57 
GeneralRe: Using find_if STL function Pin
Stuart Dootson25-Feb-08 3:02
professionalStuart Dootson25-Feb-08 3:02 
GeneralRe: Using find_if STL function Pin
ComplexLifeForm25-Feb-08 18:22
ComplexLifeForm25-Feb-08 18:22 
GeneralRe: Using find_if STL function Pin
Johann Gerell14-May-08 21:54
Johann Gerell14-May-08 21:54 
GeneralATL and javascript Pin
whizdom16-Feb-08 21:35
whizdom16-Feb-08 21:35 
GeneralRe: ATL and javascript Pin
Nathan Holt at EMOM18-Feb-08 11:48
Nathan Holt at EMOM18-Feb-08 11:48 
GeneralRe: ATL and javascript Pin
whizdom22-Feb-08 7:43
whizdom22-Feb-08 7:43 
QuestionPlease enlighten me on STL iterators and CriticalSection locking Pin
Kosta Cherry13-Feb-08 21:15
Kosta Cherry13-Feb-08 21:15 
GeneralRe: Please enlighten me on STL iterators and CriticalSection locking Pin
Andy Moore14-Feb-08 6:11
Andy Moore14-Feb-08 6:11 
GeneralRe: Please enlighten me on STL iterators and CriticalSection locking Pin
Kosta Cherry14-Feb-08 11:49
Kosta Cherry14-Feb-08 11:49 
GeneralUsing an activex control in an ATL project Pin
zon_cpp11-Feb-08 20:33
zon_cpp11-Feb-08 20:33 
GeneralRe: Using an activex control in an ATL project Pin
Stuart Dootson11-Feb-08 23:38
professionalStuart Dootson11-Feb-08 23:38 
GeneralATL: IDispEvent*Impl for n instances [modified] Pin
wickdom8-Feb-08 3:59
wickdom8-Feb-08 3:59 
GeneralRe: ATL: IDispEvent*Impl for n instances Pin
Stuart Dootson8-Feb-08 8:52
professionalStuart Dootson8-Feb-08 8:52 
GeneralRe: ATL: IDispEvent*Impl for n instances Pin
wickdom8-Feb-08 12:03
wickdom8-Feb-08 12:03 
Generalefficiency copy vector into a second vector Pin
manustone4-Feb-08 2:20
manustone4-Feb-08 2:20 
GeneralRe: efficiency copy vector into a second vector Pin
Steve Echols4-Feb-08 18:03
Steve Echols4-Feb-08 18:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.