error C2440: “初始化”: 无法从“std::_List_const_iterator<std::_List_val<std::_List_simple_types<Observer *>>>”转换为“std::_List_iterator<std::_List_val<std::_List_simple_types<Observer *>>>”

如果传递过来是一个const类型的容器,那么只能用const_iterator进行遍历

		for (std::list<Observer *>::const_iterator it = m_observers.begin(); it != m_observers.end(); ++it)
{
Observer *obj = *it;
obj->update(m_temperature, m_humidity, m_pressure);
}

error C2440的更多相关文章

  1. 孙鑫视频学习:改变窗口过程函数中出现error C2440错误的解决方法

    在Visual Studio 2010中,即使代码是完完全全按照孙鑫视频中的敲,也会在出现error C2440,这是因为开发平台由VC6.0升级至VS2010,需要将原有的项目迁移.VS2010对消 ...

  2. OpenGL与vs编程——error C2440: “glMaterialfv”: 无法从“GLfloat”转换为“const GLfloat *”

    void setMaterial(const GLfloat mat_diffuse[4],GLfloat mat_shininess){static const GLfloat mat_specul ...

  3. C++ error C2440: “类型转换” : 无法从“std::vector::iterator”转换为“

    原文地址:http://blog.csdn.net/onlyou930/article/details/5602654 圆环套圆环之迭代器 话说这一日是风平浪静,万里乌云,俺的心情好的没得说,收到命令 ...

  4. error C2440: “static_cast”: 无法从“LRESULT (__thiscall CTextProgressCtrl::* )(UINT,LPCTSTR)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)

    转自原文 error C2440 “static_cast” 无法从“void (__thiscall C* )(void)... error C2440: “static_cast”: 无法从“LR ...

  5. error C2440:“类型转换":无法从“void (__thiscall Play1::* )(int *)”转换为“cocos2d::SEL_CallFucN

    转自:http://zhidao.baidu.com/link?url=VfSSkA0xfTVwNKaKh4tqW_sXlcsK-Rb16nEtQw5zaq5_306lnwJN3Kdb-rFp-r4L ...

  6. c语言-error C2440: “static_cast”: 无法从“UINT (__thiscall CHyperLink::* )(CPoint)”转换为“LRESULT (__thiscall CWnd::* )(CPoint)”

    出现这个错误的原因可是“人力不可抗拒”之原因造成的,因为旧版本的 ON_WM_NCHITTEST 宏使用了 UINT (__thiscall CWzButton::* )(CPoint); 类型的类成 ...

  7. error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CStaticLink::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint) (转)

    原文转自 http://blog.csdn.net/yinxing408033943/article/details/7601698 解决方法: 找到  UNIT CStaticLink::OnNcH ...

  8. error C2440 “static_cast” 无法从“void (__thiscall C* )(void)...

    1.VC6中,说可以把函数在头文件中定义为:afx_msg void OnProgress()这样 但是在VS2005及以上,要求很严格,必须函数返回值为LRESULT类型,所以在VS2005及以上, ...

  9. VS error 全集(error C2664: 'CWnd::MessageBoxW' : cannot convert parameter 1 from 'char *' to 'LPCTSTR'的解决方法)

    我用的是VS2005,在编译MFC时遇到了如下错误: error C2664: 'CWnd::MessageBoxW' : cannot convert parameter 1 from 'char ...

随机推荐

  1. mysql C API 字符串玩转备份调优

  2. C#使用自定义字体(从文件获取)

    在进行软件开发,尤其是开发WinForm程序时,有时为了实现界面的美化,不可避免的需要使用一些特殊的字体,但是在开发完成之后,将程序移到其他的机器上时,由于这些机器可能没有安装相应的字体,所以整个界面 ...

  3. 多线程下不反复读取SQL Server 表的数据

    在进行一些如发送短信.邮件的业务时,我们常常会使用一个表来存储待发送的数据,由后台多个线程不断的从表中读取待发送的数据进行发送.发送完毕后再将数据转移到历史表中,这样保证待发送表的数据普通情况下不会太 ...

  4. Exchange Server 2010升级到Exchange Server 2013概览

  5. [Hapi.js] Extending the request with lifecycle events

    Instead of using middlware, hapi provides a number of points during the lifecycle of a request that ...

  6. [Regular Expressions] Find the Start and End of Whole Words

    Regular Expression Word Boundaries allow to perform "whole word only" searches within our ...

  7. boost.asio系列——Timer

    同步Timer asio中提供的timer名为deadline_timer,它提供了超时计时的功能.首先以一个最简单的同步Timer为例来演示如何使用它. #include<iostream&g ...

  8. (转)swfobject.js 详细解说

    一直想对这个应用做个总结,今天偶然百度到这个效果,为此做个笔记. 用这个js的好处: 1.IE中没有讨厌的虚框问题了.2.提供了完善的版本检测功能,如果版本不够则显示其他东西,比如图片或文字.3.易于 ...

  9. MyBatis调用Oracle的存储过程

    Mapper.xml文件: --------------------------------- <parameterMap type="map" id="class ...

  10. tabbar加小红点

    原文   http://blog.csdn.net/u013531246/article/details/44460115 #import <UIKit/UIKit.h> @interfa ...