c++ 11 이란??

|

C++11

위키백과, 우리 모두의 백과사전.

C++ 11(C++0x라고도 알려짐)은 [1] ISO가 2011년 8월 12일에 승인한 C++ 프로그래밍 언어의 최신판이다. [2] 이름은 사양이 출판되는 날짜를 언어 버전 이름으로 삼는 전통에서 유래되었다.

C++11은 핵심 언어에 여러가지를 추가하고 C++ 표준 라이브러리를 확장하고, C++ 기술 보고서 1(TR1)의 라이브러리의 수학적 특수 함수의 라이브러리 예외를 통합했다.[3] C++11은 ISO/IEC 14882:2011라고 출판되었다.

이전 표준에서의 변화[편집]

C++ 의 수정은 핵심 언어와 표준 라이브러리 모두를 포함한다. 2011 표준안의 모든 활용에 대한 개발에서, 표준 위원회에서는 몇 가지 지침을 적용했다.

  • 안정성 및 C++98(가능하면 C언어와도)과의 호환성 유지
  • 핵심 언어의 확장보다는 표준 라이브러리를 이용하려 새로운 기능 추가
  • 프로그래밍 기술을 발전시킬 변화 선호
  • 특정 애플리케이션에서만 유용한 새로운 기술보다는 시스템이나 라이브러리 디자인에 유용하게 C++을 개선
  • 이전의 안전하지 않은 기술에 대해 좀 더 안전한 대안을 제공하여 type 안전성 증가
  • 성능 향상과 하드웨어 직접 조작 능력 강화
  • 실 세계의 문제를 해결할 수 있는 해법 제시
  • "부담 최소화"의 원칙 (어떤 유틸리티가 필요로 하는 추가적인 지원은 그 유틸리티를 사용할 때만 필요해야 함)
  • 전문 프로그래머가 필요로 하는 어떤 유틸리티도 제거하지 않고도, 쉽게 가르치거나 배울 수 있어야 함

프로그래머 중 초심자가 대다수이며, 많은 초심자들은 C++에 대한 지식을 늘리기 보다는 그들에게 특화된 언어 측면에만 매진하는 경향이 있기 때문에 그들에 대해 주의를 기울이는 것이 중요하다.

C++ 언어의 문법 확장[편집]

C++ 위원회의 주된 관심은 언어 문법을 개발하는 것이다. C++0x의 프리젠테이션 일정은 표준안에서 이 부분의 진행에 영향을 받는다.

언어의 문법적 범위는 멀티태스킹 지원, 제네릭 프로그래밍 지원, 초기화 방법 통합, 성능 향상 등으로 매우 증가하였다.

이 문서의 목적에 맞게, 문법적 기능과 변화는 "런타임 성능 향상", "컴파일 성능 향상", "편의성 향상", "새로운 기능"등의 4부분으로 그룹화하였다. 일부 기능은 여러 부분에서 언급될 수 있지만, 주된 기능에 대해서 한번씩만 설명할 것이다.

핵심 언어 - 런타임 성능 향상[편집]

아래 나열된 기능은 주로 메모리나 계산 속도에 대한 성능 향상을 제공한다.

문법 기능의 편의성 향상[편집]

문법의 새로운 기능[편집]

  • 템플릿에서의 가변 인자
  • 새로운 문자열 리터럴
  • 사용자 정의 리터럴
  • 멀티태스킹 메모리 모델
  • TLS
  • 특수 멤버함수에 대해 기본값 사용및 삭제에 대한 명시적 표시
  • long long int 자료형
  • 정적 assertion
  • 멤버에 대한 sizeof 허용

C++ 표준 라이브러리의 변화[편집]

새로운 기능의 상당수는 C++0x 표준 라이브러리에서 소개된다. 이들중 상당수는 현재의 표준안에서도 구현될 수 있다. 하지만 일부는 C++0x의 새로운 문법에 의존한다.

새로운 라이브러리의 대부분은 C++ 표준 위원회의 TR1이라고 불리는 기술 보고서에서 정의되고 있으며 이는 2005년에 발표되었다. TR1의 대부분은 std::tr1 네임스페이스에서 현재 이용가능하다. C++0x에 맞게 그 네임스페이스를 std로 이동할 것이다. 하지만 C++0x 표준 라이브러리에서 TR1 기능이 제공됨에 따라, 초기 TR1에서 제공되지 않았던 기능들과 함께 적당한 위치로 업그레이드될 것이다. 또한 C++03에서 구현 가능했던 기능들을 C++0x에 맞게 향상되겠지만 오리지날 TR1 규정의 부분은 아니다.

위원회는 C++0x 표준안이 완료된 이후에 TR2를 계획하고 있다. C++0x를 만들면서 준비되지 못한 라이브러리 제안사항은 TR2나 그 뒤의 기술 보고서에서 다룰 것이다.

다음 제안 사항들은 C++0x에서 진행되고 있다.

  • 표준 라이브러리의 업그레이드
  • 스레드
  • 튜플 자료형
  • 해시 테이블
  • 정규 표현식
  • 범용 스마트 포인터
  • 확장가능한 난수 생성기
  • wrapper 레퍼런스
  • 함수객체에 대한 다형성이 있는 wrapper
  • 메타 프로그래밍을 위한 type traits
  • 함수객체의 리턴형에 대한 방법

적용[편집]

C++11은 GCC 4.3부터[4] 4.7에서[5] 시험적용되고 있고, Visual Studio 10[6]부터 Visual Studio 12[7]까지 부분적으로 적용되고 있다.

인용[편집]

  1. 이동 http://video.google.com/videoplay?docid=5262479012306588324#
  2. 이동 We have an international standard: C++0x is unanimously approved. 12 August 2011에 확인.
  3. 이동 Bjarne Stroustrup: A C++0x overview. 30 June 2011에 확인.
  4. 이동 http://gcc.gnu.org/projects/cxx0x.html
  5. 이동 http://gcc.gnu.org/gcc-4.7/cxx0x_status.html
  6. 이동 http://blogs.msdn.com/b/vcblog/archive/2010/04/06/c-0x-core-language-features-in-vc10-the-table.aspx
  7. 이동 http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx

바깥 고리[편집]






'잡다한것들전부 > C, C++, C#' 카테고리의 다른 글

추상 클래스 (C++)  (0) 2014.01.10
Duff's Device  (0) 2014.01.10
c++ 11 이란??  (0) 2014.01.09
strncpy 로 메모리 복사  (0) 2014.01.07
C언어 배열 초기화 방법  (0) 2014.01.07
c++ stl 관련 자료  (0) 2014.01.06
Trackback 0 And Comment 0

cocos2d-x v3.0 Beta 출시 되었습니다.

|

cocos2d-x v3.0 Beta


Highlights

  • New renderer. Renderer has being decoupled from the Scene Graph. It supports auto-batching and auto-culling.
  • Added template containers. cocos2d::Map<>cocos2d::Vector<>
  • Label supports: shadow, glow and outline (beta)
  • Added Joint support in the physics subsystem
  • Added Console: A simple TCP console that lets you debug and inspect your game remotely
  • tools/project_creator/project_creator.py includes a GUI to simplify the game creation process. It also allows you to create the game in any given directory.
  • Added support to build Android's APK files in the android-build.py script
  • Added Scheduler::performFunctionInCocosThread(). It supports executing a function in the cocos2d thread
  • Director emits the following events using the EventDispatcherAFTER_UPDATEAFTER_DRAW,AFTER_VISIT and PROJECTION_CHANGED
  • Added Cocos2dxActivity.java which inherits from native activity. Ingetrating 3rd Android SDK would be much easilier on v3.0.

Read more about all the new features at cocos2d-x v3.0 release notes


알파에서 베타버전으로 출시되이써습니다.

정식버전이 기대됩니다.

'잡다한것들전부 > 소식' 카테고리의 다른 글

cocos2d-x v3.0 Beta 출시 되었습니다.  (0) 2014.01.09
Trackback 0 And Comment 0

[유니티3d][에셋] 유니티 필수 에셋 iTween 에 대해서 알아보자(Action!)

|


유니티 필수 에셋 중에 하나인 아이트윈

유니티에서 물체의 움직임을 보다 쉽게 설정 할 수 있습니다.

유니티를 켜시고 에셋 스토어로 갑시다 ctrl + 9 를 누르면 Asset Store에 들어가집니다.
iTween 으로 검색하시면 아래와 같이 화면이 나오고 다운로드 버튼을 누르고 유니티 상에 import 시켜줍니다. 





파일을 여시면 sample 소스가 존재합니다. sample 소스를 보시면 iTween 이라는게 뭐구나 하고 싶게 이해 할수있으실겁니다.




간단하게 샘플 소스에 대해 알아보겠습니다.




using UnityEngine;

using System.Collections;

 

public class MoveSample : MonoBehaviour

{               

                  void Start(){

                                   iTween.MoveBy(gameObject, iTween.Hash("x", 2, "easeType", "easeInOutExpo", "loopType", "pingPong", "delay", .1));

                  }

}


moveSample 입니다.


  • MoveBy(GameObject target, Vector3 amount, float time)
  • MoveBy(GameObject target, Hashtable args)

  • moveBy를 호출하는 방법은 위와 같이 두가지 방법이 있습니다.

    첫번째는 호출 방법은 위치와 시간을 집어넣어주는 함수이고

    두번째는 호출 방법은 해쉬테이블을 집어넣는 방식입니다.


    위함수에서는

    x = 2;

    easeType = "easeInOutExpo"

    loopType = "pingPong"

    delay = .1;

    해쉬테이블의 name 에 각 값들을 집어넣은 것과 같습니다.

    해쉬테이블을 미리 선언하고 아래와 같이 집어넣을 수 도 있습니다.


    Hashtable ht = new Hashtable();
    	
    void Awake(){
    	ht.Add("x",3);
    	ht.Add("time",4);
    	ht.Add("delay",1);
    	ht.Add("onupdate","myUpdateFunction");
    	ht.Add("looptype",iTween.LoopType.pingPong);
    }
    
    void Start(){
    	iTween.MoveTo(gameObject,ht);
    }



    함수의 종류는 아래와 같습니다.


    MoveBy BACK TO TOP

    Adds the supplied coordinates to a GameObject's position.

    • MoveBy(GameObject target, Vector3 amount, float time)
    • MoveBy(GameObject target, Hashtable args)
    Property NameTypePurpose
    namestringan individual name useful for stopping iTweens by name
    amountVector3for a point in space the GameObject will animate to.
    xfloat or doublefor the individual setting of the x axis
    yfloat or doublefor the individual setting of the y axis
    zfloat or doublefor the individual setting of the z axis
    orienttopathbooleanfor whether or not the GameObject will orient to its direction of travel. False by default
    looktargetTransform or Vector3for a target the GameObject will look at
    looktimefloat or doublefor the time in seconds the object will take to look at either the "looktarget" or "orienttopath"
    axisstringrestricts rotation to the supplied axis only
    spaceSpacefor applying the transformation in either the world coordinate or local cordinate system. Defaults to local space
    timefloat or doublefor the time in seconds the animation will take to complete
    speedfloat or doublecan be used instead of time to allow animation based on speed
    delayfloat or doublefor the time in seconds the animation will wait before beginning
    easetypeEaseType or stringfor the shape of the easing curve applied to the animation
    looptypeLoopType or stringfor the type of loop to apply once the animation has completed
    onstartstringfor the name of a function to launch at the beginning of the animation
    onstarttargetGameObjectfor a reference to the GameObject that holds the "onstart" method
    onstartparamsObjectfor arguments to be sent to the "onstart" method
    onupdatestringfor the name of a function to launch on every step of the animation
    onupdatetargetGameObjectfor a reference to the GameObject that holds the "onupdate" method
    onupdateparamsObjectfor arguments to be sent to the "onupdate" method
    oncompletestringfor the name of a function to launch at the end of the animation
    oncompletetargetGameObjectfor a reference to the GameObject that holds the "oncomplete" method
    oncompleteparamsObjectfor arguments to be sent to the "oncomplete" method
    ignoretimescalebooleansetting this to true will allow the animation to continue independent of the current time which is helpful for animating menus after a game has been paused by setting Time.timeScale=0




     

    using UnityEngine;

    using System.Collections;

     

    public class RotateSample : MonoBehaviour

    {               

                      void Start(){

                                       iTween.RotateBy(gameObject, iTween.Hash("x", .25, "easeType", "easeInOutBack", "loopType", "pingPong", "delay", .4));

                      }

    }

     

     

    RotateSample 입니다.


    RotateBy BACK TO TOP

    Multiplies supplied values by 360 and rotates a GameObject by calculated amount over time.

    • RotateBy(GameObject target, Vector3 amount, float time)
    • RotateBy(GameObject target, Hashtable args)

    Property NameTypePurpose
    namestringan individual name useful for stopping iTweens by name
    amountVector3for the amount to be multiplied by 360 to rotate the GameObject.
    xfloat or doublefor the individual setting of the x axis
    yfloat or doublefor the individual setting of the y axis
    zfloat or doublefor the individual setting of the z axis
    spaceSpace or stringfor applying the transformation in either the world coordinate or local cordinate system. Defaults to local space.
    timefloat or doublefor the time in seconds the animation will take to complete
    speedfloat or doublecan be used instead of time to allow animation based on speed
    delayfloat or doublefor the time in seconds the animation will wait before beginning
    easetypeEaseType or stringfor the shape of the easing curve applied to the animation
    looptypeLoopType or stringfor the type of loop to apply once the animation has completed
    onstartstringfor the name of a function to launch at the beginning of the animation
    onstarttargetGameObjectfor a reference to the GameObject that holds the "onstart" method
    onstartparamsObjectfor arguments to be sent to the "onstart" method
    onupdatestringfor the name of a function to launch on every step of the animation
    onupdatetargetGameObjectfor a reference to the GameObject that holds the "onupdate" method
    onupdateparamsObjectfor arguments to be sent to the "onupdate" method
    oncompletestringfor the name of a function to launch at the end of the animation
    oncompletetargetGameObjectfor a reference to the GameObject that holds the "oncomplete" method
    oncompleteparamsObjectfor arguments to be sent to the "oncomplete" method
    ignoretimescalebooleansetting this to true will allow the animation to continue independent of the current time which is helpful for animating menus after a game has been paused by setting Time.timeScale=0











    보다 많은 정보는 iTwwen 홈페이지에서 찾아볼수있습니다.

    ITwen 홈페이지 :http://itween.pixelplacement.com/index.php


    관련 동영상 강좌 입니다.


    https://www.youtube.com/watch?v=qRafXt26a_E

    https://www.youtube.com/watch?v=qE5hpp4YaH4


    https://www.youtube.com/watch?v=hbSxwoWjBgQ -> 한글





    Trackback 0 And Comment 0